diff options
author | Eric Guzman | 2012-05-18 14:05:06 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-18 14:05:06 -0700 |
commit | 197a7646e472fcea616764685c8d03c6063e66f5 (patch) | |
tree | 793ef1007234f15958127b3c6f2fb3ff7b7a598b /js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js | |
parent | 18c260f5f55608d4774aea27f6c2d23e89921361 (diff) | |
download | ninja-197a7646e472fcea616764685c8d03c6063e66f5.tar.gz |
CSS Panel - Add support for deleting style sheets
Diffstat (limited to 'js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js')
-rw-r--r-- | js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js | 25 |
1 files changed, 25 insertions, 0 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 7902f80a..383fc467 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 | |||
@@ -79,6 +79,13 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
79 | } | 79 | } |
80 | }, | 80 | }, |
81 | 81 | ||
82 | handleDeleteAction : { | ||
83 | value: function(sheetComponent) { | ||
84 | this.stylesController.removeStyleSheet(sheetComponent.source); | ||
85 | this._dispatchChange(); | ||
86 | } | ||
87 | }, | ||
88 | |||
82 | /// App event handlers | 89 | /// App event handlers |
83 | /// -------------------------------- | 90 | /// -------------------------------- |
84 | 91 | ||
@@ -212,4 +219,22 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
212 | this.needsDraw = true; | 219 | this.needsDraw = true; |
213 | } | 220 | } |
214 | }, | 221 | }, |
222 | |||
223 | ///// Utilities | ||
224 | //// ------------------------------------- | ||
225 | |||
226 | _dispatchChange : { | ||
227 | value: function(category, type, data) { | ||
228 | this.application.ninja.stage.updatedStage = true; | ||
229 | |||
230 | category = category || 'elementChange'; | ||
231 | type = type || 'styleSheetRemoved'; | ||
232 | |||
233 | NJevent(category, { | ||
234 | type : type, | ||
235 | data: data, | ||
236 | redraw: null | ||
237 | }); | ||
238 | } | ||
239 | } | ||
215 | }); \ No newline at end of file | 240 | }); \ No newline at end of file |