aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/rule-list.reel/rule-list.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/rule-list.reel/rule-list.js')
-rw-r--r--js/panels/css-panel/rule-list.reel/rule-list.js29
1 files changed, 25 insertions, 4 deletions
diff --git a/js/panels/css-panel/rule-list.reel/rule-list.js b/js/panels/css-panel/rule-list.reel/rule-list.js
index 2cd5ac5c..3e18c3bf 100644
--- a/js/panels/css-panel/rule-list.reel/rule-list.js
+++ b/js/panels/css-panel/rule-list.reel/rule-list.js
@@ -12,6 +12,21 @@ exports.RuleList = Montage.create(Component, {
12 ruleNodeName : { value: 'li' }, 12 ruleNodeName : { value: 'li' },
13 _needsScrollToBottom: { value: null }, 13 _needsScrollToBottom: { value: null },
14 14
15 _hide : {
16 value: null
17 },
18 hide : {
19 get: function() {
20 return this._hide;
21 },
22 set: function(value) {
23 if(value === this._hide) { return; }
24
25 this._hide = value;
26 this.needsDraw = true;
27 }
28 },
29
15 childComponents : { 30 childComponents : {
16 value: [], 31 value: [],
17 distinct: true 32 distinct: true
@@ -138,12 +153,10 @@ exports.RuleList = Montage.create(Component, {
138 if(this._needsScrollToBottom) { 153 if(this._needsScrollToBottom) {
139 ///// Make sure the appended rule item is visible (scrolled-to) 154 ///// Make sure the appended rule item is visible (scrolled-to)
140 this.element.scrollTop = this.element.offsetHeight; 155 this.element.scrollTop = this.element.offsetHeight;
141 console.log("Scroll top:", this.element.scrollTop);
142 this._needsScrollToBottom = false; 156 this._needsScrollToBottom = false;
143 } 157 }
144 158
145 //// Iterate through all rules needing removal 159 //// Iterate through all rules needing removal
146 console.log("Rule List :: Rules to draw:,", this.rulesToDraw.length);
147 this.rulesToRemove.forEach(function(ruleComponent) { 160 this.rulesToRemove.forEach(function(ruleComponent) {
148 var componentIndex = this.childComponents.indexOf(ruleComponent); 161 var componentIndex = this.childComponents.indexOf(ruleComponent);
149 this.childComponents.splice(componentIndex, 1); 162 this.childComponents.splice(componentIndex, 1);
@@ -166,6 +179,12 @@ exports.RuleList = Montage.create(Component, {
166 ruleObj.instance.needsDraw = true; 179 ruleObj.instance.needsDraw = true;
167 }, this); 180 }, this);
168 181
182 if(this.hide) {
183 this.element.classList.add('hidden-rule-list');
184 } else {
185 this.element.classList.remove('hidden-rule-list');
186 }
187
169 } 188 }
170 }, 189 },
171 190
@@ -185,8 +204,10 @@ exports.RuleList = Montage.create(Component, {
185 this.rulesToDraw.length = 0; 204 this.rulesToDraw.length = 0;
186 this.rulesToRemove.length = 0; 205 this.rulesToRemove.length = 0;
187 206
188 this.parentComponent.ruleListDrawn = true; 207 if(!this.parentComponent.ruleListDrawn) {
189 this.parentComponent.needsDraw = true; 208 this.parentComponent.ruleListDrawn = true;
209 this.parentComponent.needsDraw = true;
210 }
190 } 211 }
191 } 212 }
192}); 213});