diff options
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/html-document.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js index 01d042d6..9a7755e6 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js | |||
@@ -392,9 +392,10 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
392 | // | 392 | // |
393 | this._templateDocument.head.innerHTML = this._userDocument.content.head; | 393 | this._templateDocument.head.innerHTML = this._userDocument.content.head; |
394 | this._templateDocument.body.innerHTML = this._userDocument.content.body; | 394 | this._templateDocument.body.innerHTML = this._userDocument.content.body; |
395 | 395 | ||
396 | 396 | // Adding a handler for the main user document reel to finish loading. | |
397 | 397 | this._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false); | |
398 | |||
398 | 399 | ||
399 | /* this.iframe.contentWindow.document.addEventListener('DOMSubtreeModified', function (e) { */ //TODO: Remove events upon loading once | 400 | /* this.iframe.contentWindow.document.addEventListener('DOMSubtreeModified', function (e) { */ //TODO: Remove events upon loading once |
400 | 401 | ||
@@ -472,12 +473,20 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
472 | 473 | ||
473 | } | 474 | } |
474 | }, | 475 | }, |
476 | |||
475 | //////////////////////////////////////////////////////////////////// | 477 | //////////////////////////////////////////////////////////////////// |
478 | |||
479 | // Handler for user content main reel. Gets called once the main reel of the template | ||
480 | // gets deserialized. | ||
481 | // Setting up the currentSelectedContainer to the document body. | ||
482 | userTemplateDidLoad: { | ||
483 | value: function(){ | ||
484 | this.application.ninja.currentSelectedContainer = this.documentRoot; | ||
485 | } | ||
486 | }, | ||
476 | 487 | ||
477 | 488 | ||
478 | 489 | //////////////////////////////////////////////////////////////////// | |
479 | |||
480 | |||
481 | _setSWFObjectScript: { | 490 | _setSWFObjectScript: { |
482 | value: function() { | 491 | value: function() { |
483 | if(!this._swfObject) { | 492 | if(!this._swfObject) { |