diffstat:
plugins/supported/appconfig/index.js | 13 +++++++++----
plugins/supported/text_editor/views/canvas.js | 9 +++++----
2 files changed, 14 insertions(+), 8 deletions(-)
diffs (69 lines):
diff --git a/plugins/supported/appconfig/index.js b/plugins/supported/appconfig/index.js
--- a/plugins/supported/appconfig/index.js
+++ b/plugins/supported/appconfig/index.js
@@ -36,6 +36,7 @@
* ***** END LICENSE BLOCK ***** */
var $ = require('jquery').$;
+var _ = require('underscore')._;
var settings = require('settings').settings;
var group = require("bespin:promise").group;
var Promise = require("bespin:promise").Promise;
@@ -335,7 +336,9 @@ var generateGUI = function(catalog, conf
// Add the 'bespin' class to the element in case it doesn't have this already.
util.addClass(element, 'bespin');
element.appendChild(container);
-
+
+ var elementAppendedQueue = [];
+
// this shouldn't be necessary, but it looks like Firefox has an issue
// with the box-ordinal-group CSS property
['north', 'west', 'center', 'east', 'south'].forEach(function(place) {
@@ -374,11 +377,13 @@ var generateGUI = function(catalog, conf
container.appendChild(element);
}
- // Call the elementAppended event if there is one.
- if (component.elementAppended) {
- component.elementAppended();
+ // Queue up the "elementAppended" event, if the component has one.
+ if (component.elementAppended != null) {
+ elementAppendedQueue.push(component);
}
});
+ _(elementAppendedQueue).invoke('elementAppended');
+
pr.resolve();
};
diff --git a/plugins/supported/text_editor/views/canvas.js b/plugins/supported/text_editor/views/canvas.js
--- a/plugins/supported/text_editor/views/canvas.js
+++ b/plugins/supported/text_editor/views/canvas.js
@@ -43,9 +43,7 @@ var Event = require('events').Event;
* @class
*
* This class provides support for manual scrolling and positioning for canvas-
- * based elements. Getting these elements to play nicely with SproutCore is
- * tricky and error-prone, so all canvas-based views should consider deriving
- * from this class. Derived views should implement drawRect() in order to
+ * based elements. Derived views should implement drawRect() in order to
* perform the appropriate canvas drawing logic.
*
* The actual size of the canvas is always the size of the container the canvas
@@ -127,7 +125,9 @@ exports.CanvasView.prototype = {
this.invalidate();
},
- drawRect: function(rect, context) { },
+ drawRect: function(rect, context) {
+ // abstract
+ },
/**
* Render the canvas. Rendering is delayed by a few ms to empty the call
@@ -314,3 +314,4 @@ Object.defineProperties(exports.CanvasVi
}
}
});
+