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/controllers/styles-controller.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'js/controllers') diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 8639bed1..87019cad 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -1433,6 +1433,9 @@ var stylesController = exports.StylesController = Montage.create(Component, { sheetEl.disabled = true; this.userStyleSheets.splice(this.userStyleSheets.indexOf(sheet), 1); + ///// Make sure cached rules from this stylesheet are not used + this._clearCache(); + ///// Check to see if we're removing the default style sheet if(sheet === this._defaultStylesheet) { sheetCount = this.userStyleSheets.length; @@ -1470,6 +1473,18 @@ var stylesController = exports.StylesController = Montage.create(Component, { } }, + setMediaAttribute : { + value: function(sheet, mediaString) { + if(sheet.media.mediaText === mediaString) { return false; } + + sheet.ownerNode.setAttribute('media', mediaString); + + this._clearCache(); + + this.styleSheetModified(sheet); + } + }, + ///// Style Sheet Modified ///// Method to call whenever a stylesheet change is made ///// Dispatches an event, and keeps list of dirty style sheets -- cgit v1.2.3