diff options
Diffstat (limited to 'js/panels/css-panel/style-sheets-view.reel')
-rw-r--r-- | js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js index cd86261c..fd559b24 100644 --- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js +++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js | |||
@@ -96,13 +96,16 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
96 | 96 | ||
97 | var sheetComponent, oldDefaultSheet; | 97 | var sheetComponent, oldDefaultSheet; |
98 | 98 | ||
99 | ///// Mark the appropriate component as the default, un-mark the previous default | ||
99 | if(this.styleSheetList) { | 100 | if(this.styleSheetList) { |
100 | sheetComponent = this.styleSheetList.childComponents[this.styleSheets.indexOf(sheet)]; | 101 | sheetComponent = this.styleSheetList.childComponents[this.styleSheets.indexOf(sheet)]; |
101 | if(sheetComponent) { | 102 | if(sheetComponent) { |
102 | sheetComponent['default'] = true; | 103 | sheetComponent['default'] = true; |
103 | if(this._defaultStyleSheet) { | 104 | if(this._defaultStyleSheet) { |
104 | oldDefaultSheet = this.styleSheetList.childComponents[this.styleSheets.indexOf(this._defaultStyleSheet)]; | 105 | oldDefaultSheet = this.styleSheetList.childComponents[this.styleSheets.indexOf(this._defaultStyleSheet)]; |
105 | oldDefaultSheet['default'] = false; | 106 | if(oldDefaultSheet) { |
107 | oldDefaultSheet['default'] = false; | ||
108 | } | ||
106 | } | 109 | } |
107 | } | 110 | } |
108 | } | 111 | } |
@@ -141,7 +144,6 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
141 | handleDeleteAction : { | 144 | handleDeleteAction : { |
142 | value: function(sheetComponent) { | 145 | value: function(sheetComponent) { |
143 | this.stylesController.removeStyleSheet(sheetComponent.source); | 146 | this.stylesController.removeStyleSheet(sheetComponent.source); |
144 | this.stylesController._clearCache(); | ||
145 | this._dispatchChange(); | 147 | this._dispatchChange(); |
146 | } | 148 | } |
147 | }, | 149 | }, |
@@ -176,7 +178,7 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
176 | } | 178 | } |
177 | }, | 179 | }, |
178 | 180 | ||
179 | handleStyleSheetModified : { | 181 | handleStyleSheetDirty : { |
180 | value: function(e) { | 182 | value: function(e) { |
181 | this.needsDraw = true; | 183 | this.needsDraw = true; |
182 | } | 184 | } |
@@ -193,7 +195,7 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
193 | prepareForDraw : { | 195 | prepareForDraw : { |
194 | value: function() { | 196 | value: function() { |
195 | this.eventManager.addEventListener("styleSheetsReady", this, false); | 197 | this.eventManager.addEventListener("styleSheetsReady", this, false); |
196 | this.eventManager.addEventListener("styleSheetModified", this, false); | 198 | this.eventManager.addEventListener("styleSheetDirty", this, false); |
197 | } | 199 | } |
198 | }, | 200 | }, |
199 | draw : { | 201 | draw : { |