aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage.reel/stage.js
diff options
context:
space:
mode:
authorPushkar Joshi2012-03-27 09:10:58 -0700
committerPushkar Joshi2012-03-27 09:10:58 -0700
commit0c26aff9c19c2b39fca06fa6b3bc76b672204065 (patch)
treee778f2b9d5d525aa364360d5996536a0a06379bd /js/stage/stage.reel/stage.js
parent753244b4713243ab19ca246be674f0b45fb85b72 (diff)
parent309dde5a8c4599cef6a1052c1ff9ee1ad8ec5858 (diff)
downloadninja-0c26aff9c19c2b39fca06fa6b3bc76b672204065.tar.gz
Merge branch 'master' into brushtool
Conflicts: js/controllers/elements/shapes-controller.js
Diffstat (limited to 'js/stage/stage.reel/stage.js')
-rwxr-xr-xjs/stage/stage.reel/stage.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index e139af97..00b72490 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -519,6 +519,36 @@ exports.Stage = Montage.create(Component, {
519 }, 519 },
520 520
521 /** 521 /**
522 * GetSelectableElement: Returns a selectable object (direct child of current container) at clicked point
523 *
524 * @param: X,Y
525 * @return: Returns the current container if the the X,Y hits an element in the exclusion list
526 */
527 GetSelectableElement: {
528 value: function(pos) {
529 var item = this.GetElement(pos);
530 if(this.application.ninja.currentDocument.inExclusion(item) !== -1) {
531 return this.application.ninja.currentSelectedContainer;
532 }
533 var activeContainerId = this.application.ninja.currentSelectedContainer.uuid;
534 if(item.parentNode.uuid === activeContainerId) {
535 return item;
536 } else {
537 var outerElement = item.parentNode;
538
539 while(outerElement.parentNode && outerElement.parentNode.uuid !== activeContainerId) {
540 // If element is higher up than current container then return
541 if(outerElement.id === "UserContent") return;
542 // else keep going up the chain
543 outerElement = outerElement.parentNode;
544 }
545
546 return outerElement;
547 }
548 }
549 },
550
551 /**
522 * GetElement: Returns the object under the X,Y coordinates passed as an obj with x,y 552 * GetElement: Returns the object under the X,Y coordinates passed as an obj with x,y
523 * 553 *
524 * @param: X,Y 554 * @param: X,Y