this approach to adding a view ensures that bookkeeping is all done sc-editor
authorKevin Dangoor <kdangoor@mozilla.com>
Mon, 26 Oct 2009 13:51:40 -0400
branchsc-editor
changeset 142 134ba8a2ef7ecdb156c4d5ba03158c64f39bba08
parent 141 5a6f18d34ac686ad8f0730c092259d8119e47c6c
child 143 2beeff68a46efa96f3785b5f8536372b3a51f462
push id53
push userkdangoor@mozilla.com
push dateMon, 26 Oct 2009 17:53:13 +0000
this approach to adding a view ensures that bookkeeping is all done (this gets the canvas onto the page properly)
src/bespin-core/lib/bespin/embed.js
--- a/src/bespin-core/lib/bespin/embed.js
+++ b/src/bespin-core/lib/bespin/embed.js
@@ -43,20 +43,19 @@ var EditorController = require('bespin/e
 exports.useBespin = function(element, options) {
     // Creating the editor alters the components innerHTML
     var originalInnerHtml = element.innerHTML;
     
     var controller = EditorController.create({});
     bespin.register("editor", controller);
     
     var editorPane = SC.Pane.create({
-        layout: {centerX: 0, centerY: 0, width: 300, height: 300},
-        childViews: ['editorView'],
-        editorView: controller.ui
+        layout: {centerX: 0, centerY: 0, width: 300, height: 300}
     });
+    editorPane.appendChild(controller.ui, null);
     SC.$(element).css('position', 'relative');
     element.innerHTML = "";
     editorPane.appendTo(element);
     if (options.initialContent) {
         controller.model.insertDocument(options.initialContent);
     } else {
         controller.model.insertDocument(originalInnerHtml);
     }