aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/styles-view-container.reel/styles-view-container.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/styles-view-container.reel/styles-view-container.js')
-rw-r--r--js/panels/css-panel/styles-view-container.reel/styles-view-container.js46
1 files changed, 43 insertions, 3 deletions
diff --git a/js/panels/css-panel/styles-view-container.reel/styles-view-container.js b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js
index 1d6d6075..32b2c3ee 100644
--- a/js/panels/css-panel/styles-view-container.reel/styles-view-container.js
+++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js
@@ -29,6 +29,7 @@ exports.StylesViewContainer = Montage.create(Component, {
29 templateDidLoad : { 29 templateDidLoad : {
30 value: function() { 30 value: function() {
31 this.eventManager.addEventListener('styleSheetsReady', this, false); 31 this.eventManager.addEventListener('styleSheetsReady', this, false);
32 //this.eventManager.addEventListener('elementChanging', this, false);
32 this.eventManager.addEventListener('elementChange', this, false); 33 this.eventManager.addEventListener('elementChange', this, false);
33 } 34 }
34 }, 35 },
@@ -44,17 +45,56 @@ exports.StylesViewContainer = Montage.create(Component, {
44 if(elements.length === 0) { 45 if(elements.length === 0) {
45 this.hasStyles = false; 46 this.hasStyles = false;
46 return false; 47 return false;
48 } else if(elements.length === 1) {
49 if(this.contentPanel === "rules") {
50 this.ruleListContainer.displayListForSelection(elements);
51 } else {
52 this.computedStyleView.declaration = elements[0];
53 }
54 } else {
55
47 } 56 }
48 57
49 this.ruleListContainer.displayListForSelection(elements);
50 this.hasStyles = true; 58 this.hasStyles = true;
51 } 59 }
52 }, 60 },
53 handleElementChange : { 61 handleElementChange : {
54 value: function(e) { 62 value: function(e) {
55 if(e._event.detail.type !== 'cssChange') { 63 var elements = this.application.ninja.selectedElements;
56 this.ruleListContainer.displayedList.component.update(); 64
65 if(elements.length === 0) {
66 return false;
67 } else if(elements.length === 1) {
68 if(this.contentPanel === "rules") {
69 if(e._event.detail.type !== 'cssChange') {
70 this.ruleListContainer.displayedList.component.update();
71 }
72 } else {
73 this.computedStyleView.declaration = elements[0];
74 }
75 } else {
76 return false;
77 }
78
79 }
80 },
81
82 handleElementChanging : {
83 value: function(e) {
84 var elements = this.application.ninja.selectedElements;
85
86 if(elements.length === 1) {
87 if(this.contentPanel === "rules") {
88// if(e._event.detail.type !== 'cssChange') {
89// this.ruleListContainer.displayedList.component.update();
90// }
91 } else {
92 this.computedStyleView.declaration = elements[0];
93 }
57 } 94 }
95
96 return false;
97
58 } 98 }
59 }, 99 },
60 100