From a62f57cf6beee332ff60a48f5e26d0084b4a5432 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 7 May 2012 10:38:29 -0700 Subject: Style sheets - Add sheet action --- js/controllers/styles-controller.js | 2 ++ js/panels/css-panel/style-sheet.reel/style-sheet.html | 14 +++----------- .../css-panel/style-sheets-view.reel/style-sheets-view.js | 10 ++-------- 3 files changed, 7 insertions(+), 19 deletions(-) (limited to 'js') diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 3422427c..dfe7c69a 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -1252,6 +1252,8 @@ var stylesController = exports.StylesController = Montage.create(Component, { doc.head.appendChild(sheetElement); sheet = this.getSheetFromElement(sheetElement, doc); + this.userStyleSheets.push(sheet); + this.styleSheetModified(sheet); NJevent('newStyleSheet', sheet); diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.html b/js/panels/css-panel/style-sheet.reel/style-sheet.html index 1820f780..6a9dee65 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.html +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html @@ -24,14 +24,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "deleteButton": {"@": "deleteButton"} } }, - "disableCheckbox": { - "module": "js/components/checkbox.reel", - "name": "Checkbox", - "properties": { - "element": { "#": "disable-checkbox" }, - "checked": true - } - }, "name": { "module": "montage/ui/dynamic-text.reel", "name": "DynamicText", @@ -114,12 +106,12 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot -
+
- + -
+
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 26b996ec..2d6e18ed 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 @@ -35,7 +35,7 @@ exports.StyleSheetsView = Montage.create(Component, { ///// Add rule button action handleAddAction : { value: function(e) { - debugger; + this.stylesController.createStylesheet(); } }, @@ -45,6 +45,7 @@ exports.StyleSheetsView = Montage.create(Component, { handleStyleSheetsReady : { value: function(e) { this.documentName = this.stylesController.activeDocument.name; + this.styleSheets = this.stylesController.userStyleSheets; this._initView = this.needsDraw = true; } }, @@ -60,7 +61,6 @@ exports.StyleSheetsView = Montage.create(Component, { prepareForDraw : { value: function() { this.eventManager.addEventListener("styleSheetsReady", this, false); - this.eventManager.addEventListener("newStyleSheet", this, false); } }, draw : { @@ -68,7 +68,6 @@ exports.StyleSheetsView = Montage.create(Component, { if(this._initView) { this.noDocumentCondition = false; this.showToolbar = true; - this.styleSheets = this.stylesController.userStyleSheets; this._initView = false; } @@ -110,11 +109,6 @@ exports.StyleSheetsView = Montage.create(Component, { } } }, - handleNewStyleSheet : { - value: function(e) { - this.styleSheets.push(e._event.detail); - } - }, handleResizeStart: { value:function(e) { this.isResizing = true; -- cgit v1.2.3