aboutsummaryrefslogtreecommitdiff
path: root/js/tools/SelectionTool.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-21 14:36:41 -0800
committerValerio Virgillito2012-02-21 14:36:41 -0800
commit1d2c928c35ccc7cd875a329b2e235f34eb4f0c0d (patch)
treefebe5a23c3667523e90de031987a11764f417da7 /js/tools/SelectionTool.js
parentb1daf0b285a4a96bfd0086709c20e3682d75551a (diff)
parentf9d34a54baf61ccdf77732b1aaedb29d296b8c2e (diff)
downloadninja-1d2c928c35ccc7cd875a329b2e235f34eb4f0c0d.tar.gz
Merge branch 'nested-selection' of https://github.com/mencio/ninja-internal into file-io
Conflicts: js/controllers/document-controller.js Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/tools/SelectionTool.js')
-rwxr-xr-xjs/tools/SelectionTool.js36
1 files changed, 14 insertions, 22 deletions
diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js
index 48548271..37029e8c 100755
--- a/js/tools/SelectionTool.js
+++ b/js/tools/SelectionTool.js
@@ -115,8 +115,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
115 HandleLeftButtonUp: { 115 HandleLeftButtonUp: {
116 value: function(event) { 116 value: function(event) {
117 var selectedItems, 117 var selectedItems,
118 point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, 118 point = webkitConvertPointFromPageToNode(this.application.ninja.stage.canvas, new WebKitPoint(event.pageX, event.pageY));
119 new WebKitPoint(event.pageX, event.pageY));
120 119
121 this.isDrawing = false; 120 this.isDrawing = false;
122 this.application.ninja.stage.showSelectionBounds = true; 121 this.application.ninja.stage.showSelectionBounds = true;
@@ -184,28 +183,21 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, {
184 } 183 }
185 }, 184 },
186 185
186 /**
187 * Double click handler
188 *
189 * Sets the currentSelectionContainer to the current selected element. If no elements are selected set the
190 * currentSelectionContainer to the userDocument div.
191 */
187 HandleDoubleClick: { 192 HandleDoubleClick: {
188 value: function(event) { 193 value: function(event) {
189 /* 194 if(this.application.ninja.selectedElements.length > 0) {
190 var selectedObject = stageManagerModule.stageManager.GetObjectFromPoint(event.layerX, event.layerY, this._canOperateOnStage); 195 this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]._element;
191 196 } else {
192 if(selectedObject) { 197 this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot;
193 if(selectionManagerModule.selectionManager.findSelectedElement(selectedObject) === -1) {
194 selectionManagerModule.selectionManager.setSingleSelection(selectedObject);
195 }
196 }
197 */
198
199 // Temporary Code for Breadcrumb
200 if(this.application.ninja.selectedElements.length > 0) {
201 this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]._element;
202 } else {
203 console.log(this.application.ninja.currentDocument.documentRoot.uuid);
204 this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.documentRoot;
205 }
206
207 } 198 }
208 }, 199 }
200 },
209 201
210 HandleKeyPress: { 202 HandleKeyPress: {
211 value: function(event){ 203 value: function(event){