diff options
author | Kruti Shah | 2012-06-19 10:12:49 -0700 |
---|---|---|
committer | Kruti Shah | 2012-06-19 10:12:49 -0700 |
commit | 4046fca0daee6e064ee5c67bd0826ac42af7718d (patch) | |
tree | a7bd30dc71dfe7e18fd78e4cd08e4a53a3a6bbd1 /js/panels | |
parent | 53a49f49ce5cd72fbb21e2840bb9622d5952d953 (diff) | |
download | ninja-4046fca0daee6e064ee5c67bd0826ac42af7718d.tar.gz |
Locked Elements. Layer Controls
Signed-off-by: Kruti Shah <kruti.shah@motorola.com>
Diffstat (limited to 'js/panels')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | 6 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 76 |
2 files changed, 81 insertions, 1 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index 9e2bacd5..eac361a8 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | |||
@@ -35,7 +35,9 @@ | |||
35 | "container_tracks" : {"#" : "container-tracks"}, | 35 | "container_tracks" : {"#" : "container-tracks"}, |
36 | "timeline_disabler" : {"#" : "timeline-disabler"}, | 36 | "timeline_disabler" : {"#" : "timeline-disabler"}, |
37 | "checkable_animated" : {"#" : "checkable_animated"}, | 37 | "checkable_animated" : {"#" : "checkable_animated"}, |
38 | "tl_configbutton" : {"#" : "tl-configbutton"} | 38 | "tl_configbutton" : {"#" : "tl-configbutton"}, |
39 | "checkable_lock" : {"#" : "checkable_lock"}, | ||
40 | "checkable_visible":{"#" : "checkable_visible"} | ||
39 | } | 41 | } |
40 | }, | 42 | }, |
41 | 43 | ||
@@ -178,6 +180,8 @@ | |||
178 | <div class="tl-configbutton" data-montage-id="tl-configbutton"> | 180 | <div class="tl-configbutton" data-montage-id="tl-configbutton"> |
179 | <div class="tl-dropdown"> | 181 | <div class="tl-dropdown"> |
180 | <div class="checkable" data-montage-id="checkable_animated">Show only animated layers</div> | 182 | <div class="checkable" data-montage-id="checkable_animated">Show only animated layers</div> |
183 | <div class="checkable" data-montage-id="checkable_lock">Lock Layers</div> | ||
184 | <div class="checkable" data-montage-id="checkable_visible">Visibility of Layers</div> | ||
181 | </div> | 185 | </div> |
182 | </div> | 186 | </div> |
183 | 187 | ||
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 339ca5a4..1ef57b13 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -580,6 +580,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
580 | // Bind the handlers for the config menu | 580 | // Bind the handlers for the config menu |
581 | this.checkable_animated.addEventListener("click", this.handleAnimatedClick.bind(this), false); | 581 | this.checkable_animated.addEventListener("click", this.handleAnimatedClick.bind(this), false); |
582 | this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false); | 582 | this.tl_configbutton.addEventListener("click", this.handleConfigButtonClick.bind(this), false); |
583 | this.checkable_lock.addEventListener("click",this.handleLockLayerClick.bind(this),false); | ||
584 | this.checkable_visible.addEventListener("click",this.handleLayerVisibleClick.bind(this),false); | ||
583 | document.addEventListener("click", this.handleDocumentClick.bind(this), false); | 585 | document.addEventListener("click", this.handleDocumentClick.bind(this), false); |
584 | 586 | ||
585 | this.addPropertyChangeListener("currentDocument.model.domContainer", this); | 587 | this.addPropertyChangeListener("currentDocument.model.domContainer", this); |
@@ -1395,6 +1397,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
1395 | thingToPush.layerData._isFirstDraw = true; | 1397 | thingToPush.layerData._isFirstDraw = true; |
1396 | thingToPush.layerData.created = true; | 1398 | thingToPush.layerData.created = true; |
1397 | thingToPush.layerData.stageElement = object; | 1399 | thingToPush.layerData.stageElement = object; |
1400 | thingToPush.layerData.isLock = false; | ||
1401 | thingToPush.layerData.isHidden = false; | ||
1402 | |||
1398 | 1403 | ||
1399 | if (this.checkable_animated.classList.contains("checked")) { | 1404 | if (this.checkable_animated.classList.contains("checked")) { |
1400 | thingToPush.layerData.isVisible = false; | 1405 | thingToPush.layerData.isVisible = false; |
@@ -1712,6 +1717,77 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
1712 | } | 1717 | } |
1713 | }, | 1718 | }, |
1714 | 1719 | ||
1720 | handleLockLayerClick:{ | ||
1721 | value:function(event){ | ||
1722 | |||
1723 | var arrLayersLength = this.arrLayers.length; | ||
1724 | console.log(this.application.ninja.currentDocument) | ||
1725 | debugger; | ||
1726 | var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; | ||
1727 | var i = 0; | ||
1728 | |||
1729 | if(event.currentTarget.classList.contains("checked")){ | ||
1730 | event.currentTarget.classList.remove("checked"); | ||
1731 | for(i=0;i<arrLayersLength;i++){ | ||
1732 | this.arrLayers[i].layerData.isLock = false; | ||
1733 | this.arrLayers[i].layerData.isSelected = true; | ||
1734 | for(var k = 0; k<lockElementArrLength; k++){ | ||
1735 | if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.stageElement){ | ||
1736 | this.application.ninja.currentDocument.lockedElements.splice(k,1); | ||
1737 | break; | ||
1738 | } | ||
1739 | } | ||
1740 | |||
1741 | } | ||
1742 | } else { | ||
1743 | for(i = 0;i < arrLayersLength;i++){ | ||
1744 | if(!this.arrLayers[i].layerData.isLock){ | ||
1745 | this.arrLayers[i].layerData.isLock = true; | ||
1746 | this.arrLayers[i].layerData.isSelected = false; | ||
1747 | this.application.ninja.currentDocument.lockedElements.push(this.arrLayers[i].layerData.stageElement); | ||
1748 | } | ||
1749 | this.selectLayers([]); | ||
1750 | |||
1751 | } | ||
1752 | event.currentTarget.classList.add("checked"); | ||
1753 | } | ||
1754 | } | ||
1755 | }, | ||
1756 | |||
1757 | handleLayerVisibleClick:{ | ||
1758 | value:function(event){ | ||
1759 | |||
1760 | var arrLayersLength = this.arrLayers.length; | ||
1761 | var lockElementArrLength = this.application.ninja.currentDocument.lockedElements.length; | ||
1762 | var i = 0; | ||
1763 | |||
1764 | if(event.currentTarget.classList.contains("checked")){ | ||
1765 | event.currentTarget.classList.remove("checked"); | ||
1766 | for(i = 0; i < arrLayersLength; i++){ | ||
1767 | this.arrLayers[i].layerData.isHidden = false; | ||
1768 | this.arrLayers[i].layerData.elementsList[0].style.visibility = "visible"; | ||
1769 | for(var k=0;k<lockElementArrLength;k++){ | ||
1770 | if(this.application.ninja.currentDocument.lockedElements[k] === this.application.ninja.timeline.arrLayers[i].layerData.stageElement){ | ||
1771 | this.application.ninja.currentDocument.lockedElements.splice(k,1); | ||
1772 | break; | ||
1773 | } | ||
1774 | } | ||
1775 | |||
1776 | } | ||
1777 | } else { | ||
1778 | for(i = 0; i < arrLayersLength; i++){ | ||
1779 | if(!this.arrLayers[i].layerData.isHidden){ | ||
1780 | this.arrLayers[i].layerData.isHidden = true; | ||
1781 | this.arrLayers[i].layerData.elementsList[0].style.visibility = "hidden"; | ||
1782 | this.application.ninja.currentDocument.lockedElements.push(this.arrLayers[i].layerData.stageElement); | ||
1783 | } | ||
1784 | |||
1785 | } | ||
1786 | event.currentTarget.classList.add("checked"); | ||
1787 | } | ||
1788 | } | ||
1789 | }, | ||
1790 | |||
1715 | // A layer's ID has been updated in the property panel. We need to update | 1791 | // A layer's ID has been updated in the property panel. We need to update |
1716 | // our layer. | 1792 | // our layer. |
1717 | handleLayerIdUpdate: { | 1793 | handleLayerIdUpdate: { |