diff options
author | Eric Guzman | 2012-03-19 11:52:35 -0700 |
---|---|---|
committer | Eric Guzman | 2012-03-19 11:52:35 -0700 |
commit | dde5b5054f93db493e5d4d502e677f5781334b08 (patch) | |
tree | 4960525a5b183f0e966462c566817331bea0f3cd /js/stage | |
parent | f08e3660384ed6ed2ba8ecf959c90fd1ade818eb (diff) | |
parent | 954f5a13e371febcb1c0fb8015c577ee51c23130 (diff) | |
download | ninja-dde5b5054f93db493e5d4d502e677f5781334b08.tar.gz |
Merge branch 'refs/heads/master' into CSSPanelUpdates
Diffstat (limited to 'js/stage')
-rwxr-xr-x | js/stage/stage.reel/stage.js | 30 |
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 |