diff options
author | Valerio Virgillito | 2012-03-16 16:36:04 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-03-16 16:36:04 -0700 |
commit | 4bec28fbd8371deceffd1563190cb5e399d554d3 (patch) | |
tree | 40f552dde11e7cd12b00ba96996783658e764835 /js/stage | |
parent | 37cc3a7824ef1844d6be22ccbbfadcdbbdaf61d2 (diff) | |
download | ninja-4bec28fbd8371deceffd1563190cb5e399d554d3.tar.gz |
Squashed commit of SnapManagerFixes
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
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 |