aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-21 17:33:11 -0800
committerValerio Virgillito2012-02-21 17:33:11 -0800
commit2f24dafec79583547fe663d5a387d8ef15aae3bf (patch)
treebd060f29cfc38c3d9707bdbc2033e9bd988a8875 /js/document
parent1d2c928c35ccc7cd875a329b2e235f34eb4f0c0d (diff)
downloadninja-2f24dafec79583547fe663d5a387d8ef15aae3bf.tar.gz
user document main reel listener moved to the html-document class.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js21
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) {