diff options
author | Valerio Virgillito | 2012-04-26 13:24:51 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-26 13:24:51 -0700 |
commit | 1ccc4d6dcff232b00763a5a49d7ad7a91f78ad3f (patch) | |
tree | 3d1f74c243cb2d12325ffba3960a63ff627e7e2c /js/document | |
parent | d0893407d35f4e05bbe2fd41c2b70151984fe481 (diff) | |
download | ninja-1ccc4d6dcff232b00763a5a49d7ad7a91f78ad3f.tar.gz |
Fixing the element model and adding get element
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/document-html.js | 6 | ||||
-rwxr-xr-x | js/document/html-document.js | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index b19ca0d0..24eb4f47 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -310,6 +310,12 @@ exports.HtmlDocument = Montage.create(Component, { | |||
310 | } | 310 | } |
311 | }, | 311 | }, |
312 | 312 | ||
313 | GetElementFromPoint: { | ||
314 | value: function(x, y) { | ||
315 | return this._window.getElement(x,y); | ||
316 | } | ||
317 | }, | ||
318 | |||
313 | // Handler for user content main reel. Gets called once the main reel of the template | 319 | // Handler for user content main reel. Gets called once the main reel of the template |
314 | // gets deserialized. | 320 | // gets deserialized. |
315 | // Setting up the currentSelectedContainer to the document body. | 321 | // Setting up the currentSelectedContainer to the document body. |
diff --git a/js/document/html-document.js b/js/document/html-document.js index 3876670c..3dbf96ce 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js | |||
@@ -759,10 +759,14 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
759 | //TODO Finish this implementation once we start caching Core Elements | 759 | //TODO Finish this implementation once we start caching Core Elements |
760 | // Assign a model to the UserContent and add the ViewPort reference to it. | 760 | // Assign a model to the UserContent and add the ViewPort reference to it. |
761 | NJUtils.makeElementModel(this.documentRoot, "Stage", "stage"); | 761 | NJUtils.makeElementModel(this.documentRoot, "Stage", "stage"); |
762 | //this.documentRoot.elementModel.viewPort = this.iframe.contentWindow.document.getElementById("Viewport"); | 762 | NJUtils.makeElementModel(this.stageBG, "Stage", "stage"); |
763 | NJUtils.makeElementModel(this.stageBG, "Stage", "stage"); | ||
764 | NJUtils.makeElementModel(this.iframe.contentWindow.document.getElementById("Viewport"), "Stage", "stage"); | 763 | NJUtils.makeElementModel(this.iframe.contentWindow.document.getElementById("Viewport"), "Stage", "stage"); |
765 | 764 | ||
765 | // Initialize the 3D properties | ||
766 | this.documentRoot.elementModel.props3D.init(this.documentRoot, true); | ||
767 | this.stageBG.elementModel.props3D.init(this.stageBG, true); | ||
768 | this.iframe.contentWindow.document.getElementById("Viewport").elementModel.props3D.init(this.iframe.contentWindow.document.getElementById("Viewport"), true); | ||
769 | |||
766 | for(i = 0; i < this._stylesheets.length; i++) { | 770 | for(i = 0; i < this._stylesheets.length; i++) { |
767 | if(this._stylesheets[i].ownerNode.id === this._stageStyleSheetId) { | 771 | if(this._stylesheets[i].ownerNode.id === this._stageStyleSheetId) { |
768 | this.documentRoot.elementModel.defaultRule = this._stylesheets[i]; | 772 | this.documentRoot.elementModel.defaultRule = this._stylesheets[i]; |