aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/style.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/css-panel/style.reel')
-rw-r--r--js/panels/css-panel/style.reel/style.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/panels/css-panel/style.reel/style.js b/js/panels/css-panel/style.reel/style.js
index b86be0ae..a8939bc6 100644
--- a/js/panels/css-panel/style.reel/style.js
+++ b/js/panels/css-panel/style.reel/style.js
@@ -131,6 +131,18 @@ exports.Style = Montage.create(TreeNode, {
131 } 131 }
132 }, 132 },
133 133
134 remove : {
135 value: function() {
136 var branchController = this.parentComponent.parentComponent.contentController;
137
138 ///// Remove style property from declaration
139 this.treeView.parentComponent.declaration.removeProperty(this.propertyField._preEditValue);
140
141 ///// Remove data from branch controller and update UI
142 branchController.removeObjects(this.sourceObject);
143 }
144 },
145
134 getRule : { 146 getRule : {
135 value: function() { 147 value: function() {
136 return this.treeView.parentComponent.declaration.parentRule; 148 return this.treeView.parentComponent.declaration.parentRule;
@@ -315,10 +327,16 @@ exports.Style = Montage.create(TreeNode, {
315 if(this.empty) { 327 if(this.empty) {
316 this.element.draggable = false; 328 this.element.draggable = false;
317 this.element.classList.add('empty-css-style'); 329 this.element.classList.add('empty-css-style');
330 if(!this.addStyleButton.parentNode) {
331 console.log("Adding style for ", this.propertyText);
332 this.element.appendChild(this.addStyleButton);
333 this.addStyleButton.addEventListener('click', this, false);
334 }
318 } else { 335 } else {
319 this.element.draggable = true; 336 this.element.draggable = true;
320 this.element.classList.remove('empty-css-style'); 337 this.element.classList.remove('empty-css-style');
321 if(this.addStyleButton.parentNode) { 338 if(this.addStyleButton.parentNode) {
339 console.log("Removing style for ", this.propertyText);
322 this.element.removeChild(this.addStyleButton); 340 this.element.removeChild(this.addStyleButton);
323 } 341 }
324 } 342 }