aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/components/layout/bread-crumb.reel/bread-crumb.js3
-rw-r--r--js/components/treeview/ninja-leaf.reel/ninja-leaf.css14
-rwxr-xr-xjs/controllers/selection-controller.js8
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js136
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-workflow-controller.js11
-rwxr-xr-xjs/lib/drawing/world.js8
-rwxr-xr-xjs/ninja.reel/ninja.html2
-rwxr-xr-xjs/panels/Splitter.js11
-rw-r--r--js/panels/presets/content.reel/content.css4
-rwxr-xr-xjs/stage/layout.js41
10 files changed, 85 insertions, 153 deletions
diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js
index ab390fc6..f35972b6 100755
--- a/js/components/layout/bread-crumb.reel/bread-crumb.js
+++ b/js/components/layout/bread-crumb.reel/bread-crumb.js
@@ -71,8 +71,7 @@ exports.Breadcrumb = Montage.create(Component, {
71 // This is always the top container which is now hardcoded to body 71 // This is always the top container which is now hardcoded to body
72 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); 72 this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"});
73 73
74 // This is for the timeline -- Disable it since the timeline should not know about this object 74
75 // NJevent('layerBinding',{selected:false ,element:this.container})
76 75
77 } 76 }
78 }, 77 },
diff --git a/js/components/treeview/ninja-leaf.reel/ninja-leaf.css b/js/components/treeview/ninja-leaf.reel/ninja-leaf.css
index fedc1d9d..cc8108f6 100644
--- a/js/components/treeview/ninja-leaf.reel/ninja-leaf.css
+++ b/js/components/treeview/ninja-leaf.reel/ninja-leaf.css
@@ -3,7 +3,12 @@
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> 3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */ 5 </copyright> */
6 6.treeRoot .branch-label, .treeRoot .leaf-label {
7 margin: 0 8px;
8}
9.treeRoot .leaf-label:hover {
10 margin: 0;
11}
7.treeRoot .leaf-label { 12.treeRoot .leaf-label {
8 background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAIAAAD9iXMrAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNS4xIE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpEQzcwMEU1RjQxM0MxMUUxQUM0MERBNzM1MUVEMUQxMCIgeG1wTU06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bVukOecU4zh2XRfKMAzTNJmYpWxgPM%2BzEIIxRrzrOs%2FzdMyVvyAxTdPxAJFzv%2BeBbz8cfN93kDzPb55ZewkwAF0Ddf6ATSsHAAAAAElFTkSuQmCC);
9 background-position: 3px center; 14 background-position: 3px center;
@@ -12,6 +17,11 @@
12 cursor: pointer; 17 cursor: pointer;
13 padding: 3px 0 4px; 18 padding: 3px 0 4px;
14} 19}
20.branch .branch .leaf-label:hover {
21 background-color: #333333;
22 background-position: 33px center;
23 padding-left: 53px;
24}
15/* First level */ 25/* First level */
16.branch .leaf-label { 26.branch .leaf-label {
17 padding-left: 25px; 27 padding-left: 25px;
@@ -26,4 +36,4 @@
26.branch .branch .branch .leaf-label { 36.branch .branch .branch .leaf-label {
27 background-position: 45px center; 37 background-position: 45px center;
28 padding-left: 65px; 38 padding-left: 65px;
29} \ No newline at end of file 39}
diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js
index c713b6e5..154fb7f8 100755
--- a/js/controllers/selection-controller.js
+++ b/js/controllers/selection-controller.js
@@ -90,15 +90,11 @@ exports.SelectionController = Montage.create(Component, {
90 } 90 }
91 }, 91 },
92 92
93 handleSwitchDocument: { 93 handleSwitchDocument: {
94 value: function() { 94 value: function() {
95 if(this.application.ninja.documentController.activeDocument.currentView === "design"){ 95 if(this.application.ninja.documentController.activeDocument.currentView === "design"){
96 this._selectedItems = this.application.ninja.selectedElements.slice(0); 96 this._selectedItems = this.application.ninja.selectedElements.slice(0);
97 if(this._selectedItems.length === 0 ){ 97 this._isDocument = this._selectedItems.length === 0;
98 this._isDocument = true;
99 }else{
100 this._isDocument = false;
101 }
102 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); 98 NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} );
103 } 99 }
104 } 100 }
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index 59da411f..1c00f7ea 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -721,8 +721,17 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
721 drawSelectionBounds : { 721 drawSelectionBounds : {
722 value: function( eltArray ) { 722 value: function( eltArray ) {
723 this._selectionCtr = null; 723 this._selectionCtr = null;
724 var len = eltArray.length,
725 i,
726 j,
727 bounds,
728 bounds3D,
729 pt,
730 tmpPt,
731 ssMat,
732 elt;
724 733
725 if (eltArray.length == 0) return; 734 if (len === 0) return;
726 var context = this._drawingContext; 735 var context = this._drawingContext;
727 if (!context) return; 736 if (!context) return;
728 737
@@ -731,18 +740,19 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
731 context.lineWidth = 2; 740 context.lineWidth = 2;
732 741
733 // handle the single element case 742 // handle the single element case
734 if (eltArray.length == 1) 743 // TODO - Currently, the stage draws its own selection bounds for single selection case
744 if (len === 1)
735 { 745 {
736 // single selection case 746 // single selection case
737 //console.log( "single selection" ); 747 //console.log( "single selection" );
738 748
739 var elt = eltArray[0]; 749 elt = eltArray[0];
740 750
741 this.viewUtils.pushViewportObj( elt ); 751 this.viewUtils.pushViewportObj( elt );
742 752
743 // get the element bounds in world space 753 // get the element bounds in world space
744 var bounds3D = this.viewUtils.getElementViewBounds3D( elt ); 754 bounds3D = this.viewUtils.getElementViewBounds3D( elt );
745 for (var j=0; j<4; j++) { 755 for (j=0; j<4; j++) {
746 bounds3D[j] = this.viewUtils.localToGlobal( bounds3D[j], elt ); 756 bounds3D[j] = this.viewUtils.localToGlobal( bounds3D[j], elt );
747 } 757 }
748 758
@@ -766,19 +776,12 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
766 } 776 }
767 else 777 else
768 { 778 {
769 // the multiple selection case.
770 //console.log( "multiple selection" );
771
772 // we set the root to "the world".
773 var saveRoot = this.viewUtils.getRootElement();
774 this.viewUtils.setRootElement( this.viewUtils.getStageElement() );
775
776 // get the plane from the first element to compare against the other elements 779 // get the plane from the first element to compare against the other elements
777 var flat = true; 780 var flat = true;
778 var plane = this.viewUtils.getElementPlane( eltArray[0] ); 781 var plane = this.viewUtils.getElementPlane( eltArray[0] );
779 for (var i=1; i<eltArray.length; i++) 782 for (i=1; i<len; i++)
780 { 783 {
781 var elt = eltArray[i]; 784 elt = eltArray[i];
782 var plane2 = this.viewUtils.getElementPlane( elt ); 785 var plane2 = this.viewUtils.getElementPlane( elt );
783 var dot = MathUtils.dot3(plane,plane2); 786 var dot = MathUtils.dot3(plane,plane2);
784 if (MathUtils.fpCmp(dot, 1) != 0) 787 if (MathUtils.fpCmp(dot, 1) != 0)
@@ -796,34 +799,23 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
796 } 799 }
797 } 800 }
798 801
799 // construct a matrix from world space to 'plane' space
800 var ptOnPlane = this.viewUtils.localToGlobal( [0,0,0], eltArray[0]);
801 var planeToWorld = this.getPlaneToWorldMatrix( plane, ptOnPlane );
802 //var worldToPlane = planeToWorld.inverse();
803 var worldToPlane = glmat4.inverse(planeToWorld, []);
804
805 var ssMat = this.viewUtils.getLocalToGlobalMatrix( this._sourceSpaceElt );
806 // if all the elements share the same plane, draw the 2D rectangle 802 // if all the elements share the same plane, draw the 2D rectangle
807 if (flat) 803 if (flat)
808 { 804 {
809 // make a 2D rectangle on the plane 805 // make a 2D rectangle on the plane
810 var rect; 806 var rect;
811 for (var i=0; i<eltArray.length; i++) 807 for (i=0; i<len; i++)
812 { 808 {
813 var elt = eltArray[i]; 809 elt = eltArray[i];
814 810
815 // get the element bounds in 'plane' space 811 // get the element bounds in 'plane' space
816 var bounds = this.viewUtils.getElementViewBounds3D( elt ); 812 bounds = this.viewUtils.getElementViewBounds3D( elt );
817 for (var j=0; j<4; j++) 813 ssMat = this.viewUtils.getLocalToGlobalMatrix( elt );
814 for (j=0; j<4; j++)
818 { 815 {
819// var gPt = MathUtils.makeDimension4( this.viewUtils.localToGlobal( bounds[j], elt ) );