From 36be3f52a0eaf176213f4d46056e684e0a1b7653 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 18 Jul 2012 17:11:40 -0700 Subject: Style Sheets - Show dirty marker when editing media attribute --- js/panels/css-panel/style-sheet.reel/style-sheet.js | 2 +- js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'js/panels') diff --git a/js/panels/css-panel/style-sheet.reel/style-sheet.js b/js/panels/css-panel/style-sheet.reel/style-sheet.js index 8a8e7dbf..3a0060b2 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.js +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js @@ -202,7 +202,7 @@ exports.StyleSheet = Montage.create(Component, { set : function(value) { if(value === this._mediaText) { return; } - this._source.ownerNode.setAttribute('media', value); + this.application.ninja.stylesController.setMediaAttribute(this._source, value); this._mediaText = value; 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 e2193ba0..a328cb65 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, { var sheetComponent, oldDefaultSheet; + ///// Mark the appropriate component as the default, un-mark the previous default if(this.styleSheetList) { sheetComponent = this.styleSheetList.childComponents[this.styleSheets.indexOf(sheet)]; if(sheetComponent) { sheetComponent['default'] = true; if(this._defaultStyleSheet) { oldDefaultSheet = this.styleSheetList.childComponents[this.styleSheets.indexOf(this._defaultStyleSheet)]; - oldDefaultSheet['default'] = false; + if(oldDefaultSheet) { + oldDefaultSheet['default'] = false; + } } } } -- cgit v1.2.3