aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels')
-rwxr-xr-xjs/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js10
-rwxr-xr-xjs/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js2
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js37
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js2
-rw-r--r--js/panels/presets/animations-presets.reel/animations-presets.js4
-rw-r--r--js/panels/presets/style-presets.reel/style-presets.js4
-rw-r--r--js/panels/presets/transitions-presets.reel/transitions-presets.js4
-rwxr-xr-xjs/panels/properties.reel/properties.js16
-rwxr-xr-xjs/panels/properties.reel/sections/three-d-view.reel/three-d-view.js2
9 files changed, 48 insertions, 33 deletions
diff --git a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
index 0c950ffd..2a3fc068 100755
--- a/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
+++ b/js/panels/CSSPanel/CSSPanelBase.reel/CSSPanelBase.js
@@ -520,9 +520,7 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre
520 this.inComputedStyleMode = false; // No computed styles mode for multiple items 520 this.inComputedStyleMode = false; // No computed styles mode for multiple items
521 521
522 ///// if multiple items are selected, then show common rules 522 ///// if multiple items are selected, then show common rules
523 var elements = items.map(function(item) { 523 var elements = Array.prototype.slice.call(this.application.ninja.selectedElements, 0);
524 return item._element;
525 });
526 524
527 ///// show toolbar, but hide computed style button 525 ///// show toolbar, but hide computed style button
528 this.sections.styles.toolbar.style.display = ''; 526 this.sections.styles.toolbar.style.display = '';
@@ -538,7 +536,7 @@ var CSSPanel = exports.CSSPanelBase = (require("montage/core/core").Montage).cre
538 this.sections.styles.statusMsg.classList.add('nj-css-panel-hide'); 536 this.sections.styles.statusMsg.classList.add('nj-css-panel-hide');
539 this.sections.styles.showComputedEl.classList.remove('nj-css-panel-hide');// .style.display = ''; 537 this.sections.styles.showComputedEl.classList.remove('nj-css-panel-hide');// .style.display = '';
540 this.sections.styles.toolbar.style.display = ''; 538 this.sections.styles.toolbar.style.display = '';
541 this.showStylesForElement(items[0]._element, null); 539 this.showStylesForElement(items[0], null);
542 } else { 540 } else {
543 this.sections.styles.statusMsg.classList.add('nj-css-panel-hide'); 541 this.sections.styles.statusMsg.classList.add('nj-css-panel-hide');
544 this._inMultiSelectMode = false; 542 this._inMultiSelectMode = false;
@@ -1691,7 +1689,7 @@ NJCSSStyle.prototype.styleChange = function() {
1691NJCSSStyle.prototype.getUnits = function(val) { 1689NJCSSStyle.prototype.getUnits = function(val) {
1692 if(val.split(/\s/).length > 1) { 1690 if(val.split(/\s/).length > 1) {
1693 return false; 1691 return false;
1694 } else if(/px|em|pt|in|cm|mm|ex|pc|%/.test(val)) { 1692 } else if(/(px|em|pt|in|cm|mm|ex|pc|%)$/.test(val)) {
1695 return val.replace(/^.*(px|em|pt|in|cm|mm|ex|pc|%).*/, '$1'); 1693 return val.replace(/^.*(px|em|pt|in|cm|mm|ex|pc|%).*/, '$1');
1696 } 1694 }
1697 return null; 1695 return null;
@@ -1771,7 +1769,7 @@ NJCSSStyle.prototype.updateValue = function(newValue, bypassUndo) {
1771 this.styleChange(); 1769 this.styleChange();
1772 return true; 1770 return true;
1773 } 1771 }
1774 1772
1775 var IMPORTANT_FLAG = ' !important', 1773 var IMPORTANT_FLAG = ' !important',
1776 dec = this.njRule.declaration, 1774 dec = this.njRule.declaration,
1777 acceptAsValid = false, 1775 acceptAsValid = false,
diff --git a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
index 3505393c..e990551b 100755
--- a/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
+++ b/js/panels/Components/ComponentsPanelBase.reel/ComponentsPanelBase.js
@@ -302,7 +302,7 @@ var ComponentsPanelBase = exports.ComponentsPanelBase = Montage.create(Component
302 302
303 that.application.ninja.currentDocument.setComponentInstance(instance, element); 303 that.application.ninja.currentDocument.setComponentInstance(instance, element);
304 304
305 NJevent("elementAdding", {"el": element, "data":styles}); 305 that.application.ninja.elementMediator.addElements(element, styles);
306 }); 306 });
307 307
308 } 308 }
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index a1e320c4..033d0f79 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -318,7 +318,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
318 "newLayer", 318 "newLayer",
319 "deleteLayer", 319 "deleteLayer",
320 "elementAdded", 320 "elementAdded",
321 "elementDeleted", 321 "elementsRemoved",
322 "selectionChange"], 322 "selectionChange"],
323 i, 323 i,
324 arrEventsLength = arrEvents.length; 324 arrEventsLength = arrEvents.length;
@@ -826,7 +826,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
826 for(var index=0;index<arrLayerLength;index++){ 826 for(var index=0;index<arrLayerLength;index++){
827 if(this.arrLayers[index].layerData.layerID===dLayer[hashVariable].layerID){ 827 if(this.arrLayers[index].layerData.layerID===dLayer[hashVariable].layerID){
828 dLayer[hashVariable].deleted = true; 828 dLayer[hashVariable].deleted = true;
829 ElementMediator.deleteElements(dLayer[hashVariable].elementsList); 829 ElementMediator.removeElements(dLayer[hashVariable].elementsList);
830 this.arrLayers.splice(index, 1); 830 this.arrLayers.splice(index, 1);
831 break; 831 break;
832 } 832 }
@@ -861,18 +861,37 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
861 } 861 }
862 }, 862 },
863 863
864 handleElementDeleted:{ 864 handleElementsRemoved:{
865 value:function (event) { 865 value:function (event) {
866 var length,lengthVal; 866 var length,lengthVal;
867 this.deleteElement = event.detail; 867 this.deleteElement = event.detail;
868 lengthVal = this.currentLayerSelected.layerData.elementsList.length - 1; 868
869 for (length = lengthVal ;length >= 0 ;length--) { 869 // Handling deletion of multiple elements.
870 if (this.currentLayerSelected.layerData.elementsList[length] === this.deleteElement) { 870 // TODO: Optimize this double array loop
871 this.currentLayerSelected.layerData.elementsList.splice(length, 1); 871 if(Array.isArray(this.deleteElement)) {
872 break; 872 this.deleteElement = Array.prototype.slice.call(this.deleteElement, 0);
873 lengthVal = this.currentLayerSelected.layerData.elementsList.length - 1;
874 this.deleteElement.forEach(function(element) {
875 for (length = lengthVal ;length >= 0 ;length--) {
876 if (this.currentLayerSelected.layerData.elementsList[length] === element) {
877 this.currentLayerSelected.layerData.elementsList.splice(length, 1);
878 break;
879 }
880 //length--;
881 }
882 }, this);
883 } else {
884 lengthVal = this.currentLayerSelected.layerData.elementsList.length - 1;
885 for (length = lengthVal ;length >= 0 ;length--) {
886 if (this.currentLayerSelected.layerData.elementsList[length] === this.deleteElement) {
887 this.currentLayerSelected.layerData.elementsList.splice(length, 1);
888 break;
889 }
890 //length--;
873 } 891 }
874 //length--;
875 } 892 }
893
894
876 } 895 }
877 }, 896 },
878 897
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 2b308d9a..7339139f 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -162,7 +162,7 @@ var Tween = exports.Tween = Montage.create(Component, {
162 162
163 if (event.detail.source && event.detail.source !== "tween") { 163 if (event.detail.source && event.detail.source !== "tween") {
164 // check for correct element selection 164 // check for correct element selection
165 if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) { 165 if (this.application.ninja.selectedElements[0]!= this.parentComponent.parentComponent.animatedElement) {
166 console.log("Wrong element selected for this keyframe track"); 166 console.log("Wrong element selected for this keyframe track");
167 } else { 167 } else {
168 // update tweenedProperties and tell containing track to update CSS rule 168 // update tweenedProperties and tell containing track to update CSS rule
diff --git a/js/panels/presets/animations-presets.reel/animations-presets.js b/js/panels/presets/animations-presets.reel/animations-presets.js
index 6a16da54..92437cfd 100644
--- a/js/panels/presets/animations-presets.reel/animations-presets.js
+++ b/js/panels/presets/animations-presets.reel/animations-presets.js
@@ -23,6 +23,6 @@ exports.AnimationsLibrary = Montage.create(Component, {
23 handleNodeActivation: { 23 handleNodeActivation: {
24 value: function(presetData) { 24 value: function(presetData) {
25 this.application.ninja.presetsController.applyPreset(presetData); 25 this.application.ninja.presetsController.applyPreset(presetData);
26 } 26 }
27 } 27 }
28}); 28});
diff --git a/js/panels/presets/style-presets.reel/style-presets.js b/js/panels/presets/style-presets.reel/style-presets.js
index 6a28e069..5f10bbe3 100644
--- a/js/panels/presets/style-presets.reel/style-presets.js
+++ b/js/panels/presets/style-presets.reel/style-presets.js
@@ -23,12 +23,12 @@ exports.StylesLibrary = Montage.create(Component, {
23 handleNodeActivation: { 23 handleNodeActivation: {
24 value: function(presetData) { 24 value: function(presetData) {
25 this.application.ninja.presetsController.applyPreset(presetData, true); 25 this.application.ninja.presetsController.applyPreset(presetData, true);
26 } 26 }
27 }, 27 },
28 handleDragEnd : { 28 handleDragEnd : {
29 value: function(sourceObject) { 29 value: function(sourceObject) {
30 console.log(sourceObject); 30 console.log(sourceObject);
31 } 31 }
32 } 32 }
33 33
34}); 34});
diff --git a/js/panels/presets/transitions-presets.reel/transitions-presets.js b/js/panels/presets/transitions-presets.reel/transitions-presets.js
index ace38dbb..4ca2a662 100644
--- a/js/panels/presets/transitions-presets.reel/transitions-presets.js
+++ b/js/panels/presets/transitions-presets.reel/transitions-presets.js
@@ -23,6 +23,6 @@ exports.TransitionsLibrary = Montage.create(Component, {
23 handleNodeActivation: { 23 handleNodeActivation: {
24 value: function(presetData) { 24 value: function(presetData) {
25 this.application.ninja.presetsController.applyPreset(presetData); 25 this.application.ninja.presetsController.applyPreset(presetData);
26 } 26 }