diff options
4 files changed, 26 insertions, 5 deletions
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 89a389a4..8639bed1 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js | |||
@@ -1405,7 +1405,8 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1405 | rel : 'stylesheet', | 1405 | rel : 'stylesheet', |
1406 | id : id || "", | 1406 | id : id || "", |
1407 | media : 'screen', | 1407 | media : 'screen', |
1408 | title : 'Temp' | 1408 | title : 'Temp', |
1409 | 'data-ninja-node' : 'true' | ||
1409 | }); | 1410 | }); |
1410 | 1411 | ||
1411 | doc.head.appendChild(sheetElement); | 1412 | doc.head.appendChild(sheetElement); |
@@ -1486,6 +1487,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1486 | ///// If the sheet doesn't already exist in the list of modified | 1487 | ///// If the sheet doesn't already exist in the list of modified |
1487 | ///// sheets, dispatch dirty event and add the sheet to the list | 1488 | ///// sheets, dispatch dirty event and add the sheet to the list |
1488 | if(sheetSearch.length === 0) { | 1489 | if(sheetSearch.length === 0) { |
1490 | NJevent('styleSheetDirty', eventData); | ||
1489 | this.dirtyStyleSheets.push({ | 1491 | this.dirtyStyleSheets.push({ |
1490 | document : sheet.ownerNode.ownerDocument, | 1492 | document : sheet.ownerNode.ownerDocument, |
1491 | stylesheet : sheet | 1493 | stylesheet : 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 035bc760..01b5f20c 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.html +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html | |||
@@ -62,6 +62,9 @@ POSSIBILITY OF SUCH DAMAGE. | |||
62 | "prototype": "js/components/textfield.reel[TextField]", | 62 | "prototype": "js/components/textfield.reel[TextField]", |
63 | "properties": { | 63 | "properties": { |
64 | "element": {"#": "media-input"} | 64 | "element": {"#": "media-input"} |
65 | }, | ||
66 | "bindings": { | ||
67 | "value": {"<->": "@owner.mediaText"} | ||
65 | } | 68 | } |
66 | }, | 69 | }, |
67 | "editButton": { | 70 | "editButton": { |
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 b7df05a7..8a8e7dbf 100644 --- a/js/panels/css-panel/style-sheet.reel/style-sheet.js +++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js | |||
@@ -71,6 +71,9 @@ exports.StyleSheet = Montage.create(Component, { | |||
71 | prepareForDraw : { | 71 | prepareForDraw : { |
72 | value: function() { | 72 | value: function() { |
73 | this.nameText.element.addEventListener('click', this, false); | 73 | this.nameText.element.addEventListener('click', this, false); |
74 | |||
75 | //// Set the initial media text value | ||
76 | this.mediaText = this._source.media.mediaText; | ||
74 | } | 77 | } |
75 | }, | 78 | }, |
76 | 79 | ||
@@ -89,8 +92,6 @@ exports.StyleSheet = Montage.create(Component, { | |||
89 | value: function() { | 92 | value: function() { |
90 | var transStr = '-webkit-transform'; | 93 | var transStr = '-webkit-transform'; |
91 | 94 | ||
92 | this.mediaInput.value = this._source.media.mediaText; | ||
93 | |||
94 | if(this.editing) { | 95 | if(this.editing) { |
95 | this.editView.classList.add('expanded'); | 96 | this.editView.classList.add('expanded'); |
96 | this.editView.style.setProperty(transStr, 'translate3d(-'+ this._translateDistance + 'px,0,0)'); | 97 | this.editView.style.setProperty(transStr, 'translate3d(-'+ this._translateDistance + 'px,0,0)'); |
@@ -194,6 +195,21 @@ exports.StyleSheet = Montage.create(Component, { | |||
194 | this._name = text; | 195 | this._name = text; |
195 | } | 196 | } |
196 | }, | 197 | }, |
198 | |||
199 | _mediaText : { value: null }, | ||
200 | mediaText : { | ||
201 | get : function() { return this._mediaText; }, | ||
202 | set : function(value) { | ||
203 | if(value === this._mediaText) { return; } | ||
204 | |||
205 | this._source.ownerNode.setAttribute('media', value); | ||
206 | |||
207 | this._mediaText = value; | ||
208 | |||
209 | this.needsDraw = true; | ||
210 | } | ||
211 | }, | ||
212 | |||
197 | _dirty : { | 213 | _dirty : { |
198 | value: null | 214 | value: null |
199 | }, | 215 | }, |
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 cd86261c..e2193ba0 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 | |||
@@ -176,7 +176,7 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
176 | } | 176 | } |
177 | }, | 177 | }, |
178 | 178 | ||
179 | handleStyleSheetModified : { | 179 | handleStyleSheetDirty : { |
180 | value: function(e) { | 180 | value: function(e) { |
181 | this.needsDraw = true; | 181 | this.needsDraw = true; |
182 | } | 182 | } |
@@ -193,7 +193,7 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
193 | prepareForDraw : { | 193 | prepareForDraw : { |
194 | value: function() { | 194 | value: function() { |
195 | this.eventManager.addEventListener("styleSheetsReady", this, false); | 195 | this.eventManager.addEventListener("styleSheetsReady", this, false); |
196 | this.eventManager.addEventListener("styleSheetModified", this, false); | 196 | this.eventManager.addEventListener("styleSheetDirty", this, false); |
197 | } | 197 | } |
198 | }, | 198 | }, |
199 | draw : { | 199 | draw : { |