aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-08 16:30:30 -0700
committerValerio Virgillito2012-05-08 16:30:30 -0700
commitd55b7418119c380241f6a2788ff8c84fcd44e143 (patch)
treea86bdbf0ce4628d9f87067c66dba6addd707d375 /js
parentcb9e4b68b307f3bbc898fd482eb2668120cd4d18 (diff)
parentc79814664f3002613b3f12106edffc64932fa4ac (diff)
downloadninja-d55b7418119c380241f6a2788ff8c84fcd44e143.tar.gz
Merge pull request #203 from mqg734/Dom-Architecture
Get clicked element when body is scrolled. Also fixed zoom code's iframe reference.
Diffstat (limited to 'js')
-rwxr-xr-xjs/document/templates/montage-web/index.html5
-rwxr-xr-xjs/stage/stage.reel/stage.js11
2 files changed, 12 insertions, 4 deletions
diff --git a/js/document/templates/montage-web/index.html b/js/document/templates/montage-web/index.html
index 47964ae4..6bd5ce7a 100755
--- a/js/document/templates/montage-web/index.html
+++ b/js/document/templates/montage-web/index.html
@@ -26,6 +26,11 @@
26 -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); 26 -webkit-transform: perspective(1400) matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
27 } 27 }
28 28
29 html {
30 overflow: scroll;
31 padding: 0 11px 11px 0;
32 }
33
29 html, body { 34 html, body {
30 width: 100%; 35 width: 100%;
31 height: 100%; 36 height: 100%;
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 1f661513..dc6444ff 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -551,13 +551,16 @@ exports.Stage = Montage.create(Component, {
551 */ 551 */
552 getElement: { 552 getElement: {
553 value: function(position, selectable) { 553 value: function(position, selectable) {
554 var point, element; 554 var point, element,
555 docView = this.application.ninja.currentDocument.model.views.design;
555 556
556 point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(position.pageX, position.pageY)); 557 point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(position.pageX - docView.iframe.contentWindow.pageXOffset, position.pageY - docView.iframe.contentWindow.pageYOffset));
557 element = this.application.ninja.currentDocument.model.views.design.getElementFromPoint(point.x + this.userContentLeft,point.y + this.userContentTop); 558 element = this.application.ninja.currentDocument.model.views.design.getElementFromPoint(point.x - this.userContentLeft,point.y - this.userContentTop);
558 559
560 if(!element) debugger;
559 // workaround Chrome 3d bug 561 // workaround Chrome 3d bug
560 if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.application.ninja.currentDocument.inExclusion(element) !== -1) { 562 if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.application.ninja.currentDocument.inExclusion(element) !== -1) {
563 point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(position.pageX, position.pageY));
561 element = this.getElementUsingSnapping(point); 564 element = this.getElementUsingSnapping(point);
562 } 565 }
563 566
@@ -888,7 +891,7 @@ exports.Stage = Montage.create(Component, {
888 //TODO - Maybe move to mediator. 891 //TODO - Maybe move to mediator.
889 var newVal = value/100.0; 892 var newVal = value/100.0;
890 if (newVal >= 1) 893 if (newVal >= 1)
891 this.application.ninja.currentDocument.iframe.style.zoom = value/100; 894 this.application.ninja.currentDocument.model.views.design.iframe.style.zoom = value/100;
892 895
893 this.updatedStage = true; 896 this.updatedStage = true;
894 897