aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorEric Guzman2012-07-18 17:11:40 -0700
committerEric Guzman2012-07-18 17:11:40 -0700
commit36be3f52a0eaf176213f4d46056e684e0a1b7653 (patch)
tree64468600712fdad6657727b19b3908ddc4b898a6 /js/controllers
parent693d9cd24e9eeee084614925c2a4a8e757f0a82f (diff)
downloadninja-36be3f52a0eaf176213f4d46056e684e0a1b7653.tar.gz
Style Sheets - Show dirty marker when editing media attribute
Diffstat (limited to 'js/controllers')
-rwxr-xr-xjs/controllers/styles-controller.js15
1 files changed, 15 insertions, 0 deletions
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, {
1433 sheetEl.disabled = true; 1433 sheetEl.disabled = true;
1434 this.userStyleSheets.splice(this.userStyleSheets.indexOf(sheet), 1); 1434 this.userStyleSheets.splice(this.userStyleSheets.indexOf(sheet), 1);
1435 1435
1436 ///// Make sure cached rules from this stylesheet are not used
1437 this._clearCache();
1438
1436 ///// Check to see if we're removing the default style sheet 1439 ///// Check to see if we're removing the default style sheet
1437 if(sheet === this._defaultStylesheet) { 1440 if(sheet === this._defaultStylesheet) {
1438 sheetCount = this.userStyleSheets.length; 1441 sheetCount = this.userStyleSheets.length;
@@ -1470,6 +1473,18 @@ var stylesController = exports.StylesController = Montage.create(Component, {
1470 } 1473 }
1471 }, 1474 },
1472 1475
1476 setMediaAttribute : {
1477 value: function(sheet, mediaString) {
1478 if(sheet.media.mediaText === mediaString) { return false; }
1479
1480 sheet.ownerNode.setAttribute('media', mediaString);
1481
1482 this._clearCache();
1483
1484 this.styleSheetModified(sheet);
1485 }
1486 },
1487
1473 ///// Style Sheet Modified 1488 ///// Style Sheet Modified
1474 ///// Method to call whenever a stylesheet change is made 1489 ///// Method to call whenever a stylesheet change is made
1475 ///// Dispatches an event, and keeps list of dirty style sheets 1490 ///// Dispatches an event, and keeps list of dirty style sheets