aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/controllers/styles-controller.js23
-rw-r--r--js/panels/css-panel/css-panel.reel/css-panel.html3
-rw-r--r--js/panels/css-panel/css-style.reel/css-style.js13
-rw-r--r--js/panels/css-panel/style-sheet.reel/style-sheet.html16
-rw-r--r--js/panels/css-panel/style-sheet.reel/style-sheet.js21
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html24
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js25
-rw-r--r--js/panels/css-panel/styles-view-container.reel/styles-view-container.html1
8 files changed, 68 insertions, 58 deletions
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js
index f6977a00..c5076771 100755
--- a/js/controllers/styles-controller.js
+++ b/js/controllers/styles-controller.js
@@ -821,7 +821,7 @@ var stylesController = exports.StylesController = Montage.create(Component, {
821 ///// method to apply/test the new value 821 ///// method to apply/test the new value
822 dec.setProperty(property, value, priority); 822 dec.setProperty(property, value, priority);
823 823
824 if(rule.parentStyleSheet) { 824 if(rule.type !== 'inline' && rule.parentStyleSheet) {
825 this.styleSheetModified(rule.parentStyleSheet); 825 this.styleSheetModified(rule.parentStyleSheet);
826 } 826 }
827 827
@@ -1289,6 +1289,27 @@ var stylesController = exports.StylesController = Montage.create(Component, {
1289 return sheet; 1289 return sheet;
1290 } 1290 }
1291 }, 1291 },
1292
1293 ///// Remove Style sheet
1294 ///// Removes style sheet from document
1295
1296 removeStyleSheet : {
1297 value: function(sheet) {
1298 var sheetEl = sheet.ownerNode;
1299
1300 if(sheetEl) {
1301 sheetEl.disabled = true;
1302 this.userStyleSheets.splice(this.userStyleSheets.indexOf(sheet), 1);
1303
1304 ///// Mark for removal for i/o
1305 sheetEl.setAttribute('data-ninja-remove', 'true');
1306
1307 NJevent('removeStyleSheet', sheet);
1308 }
1309
1310
1311 }
1312 },
1292 1313
1293 ///// Gets the stylesheet object associated with passed-in 1314 ///// Gets the stylesheet object associated with passed-in
1294 ///// element or element id, with option context (document) 1315 ///// element or element id, with option context (document)
diff --git a/js/panels/css-panel/css-panel.reel/css-panel.html b/js/panels/css-panel/css-panel.reel/css-panel.html
index 5bc5c87d..54bb1fae 100644
--- a/js/panels/css-panel/css-panel.reel/css-panel.html
+++ b/js/panels/css-panel/css-panel.reel/css-panel.html
@@ -15,7 +15,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
15 "name" : "CSSPanelNew", 15 "name" : "CSSPanelNew",
16 "properties" : { 16 "properties" : {
17 "element" : {"#" : "container"}, 17 "element" : {"#" : "container"},
18 "styleSheetsView": {"@": "styleSheetsView"} 18 "styleSheetsView": {"@": "styleSheetsView"},
19 "stylesViewContainer": {"@": "stylesViewContainer"}
19 } 20 }
20 }, 21 },
21 22
diff --git a/js/panels/css-panel/css-style.reel/css-style.js b/js/panels/css-panel/css-style.reel/css-style.js
index 3a07f8f1..1787665f 100644
--- a/js/panels/css-panel/css-style.reel/css-style.js
+++ b/js/panels/css-panel/css-style.reel/css-style.js
@@ -143,17 +143,8 @@ exports.CssStyle = Montage.create(Component, {
143 143
144 getRule : { 144 getRule : {
145 value: function() { 145 value: function() {
146 //var declarationComponent = this.treeView.parentComponent, 146 var declarationComponent = this.parentComponent.parentComponent.parentComponent
147 var declarationComponent = this.parentComponent.parentComponent.parentComponent, 147 return declarationComponent.rule;
148 rule;
149
150 if(declarationComponent.type === 'inline') {
151 rule = { style : declarationComponent.declaration }
152 } else {
153 rule = this.parentComponent.parentComponent.parentComponent.declaration.parentRule;
154 }
155
156 return rule;
157 } 148 }
158 }, 149 },
159 150
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 ca24487d..788cafcc 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.html
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.html
@@ -20,7 +20,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
20 "editButton": {"@": "editButton"}, 20 "editButton": {"@": "editButton"},
21 "editView": {"#": "style-sheet-edit"}, 21 "editView": {"#": "style-sheet-edit"},
22 "disableButton": {"@": "disableButton"}, 22 "disableButton": {"@": "disableButton"},
23 "importButton": {"@": "importButton"},
24 "deleteButton": {"@": "deleteButton"} 23 "deleteButton": {"@": "deleteButton"}
25 } 24 }
26 }, 25 },
@@ -75,20 +74,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
75 }] 74 }]
76 75
77 }, 76 },
78 "importButton": {
79 "module": "montage/ui/button.reel",
80 "name": "Button",
81 "properties": {
82 "element": {"#": "import-button"},
83 "identifier": "importButton",
84 "label": "Import"
85 },
86 "listeners": [{
87 "type": "action",
88 "listener": {"@": "owner"}
89 }]
90
91 },
92 "deleteButton": { 77 "deleteButton": {
93 "module": "montage/ui/button.reel", 78 "module": "montage/ui/button.reel",
94 "name": "Button", 79 "name": "Button",
@@ -118,7 +103,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
118 103
119 <button data-montage-id="edit-button" class="ss-edit-button"></button> 104 <button data-montage-id="edit-button" class="ss-edit-button"></button>
120 <button data-montage-id="delete-button" class="ss-delete-button nj-skinned"></button> 105 <button data-montage-id="delete-button" class="ss-delete-button nj-skinned"></button>
121 <button data-montage-id="import-button" class="ss-import-button nj-skinned"></button>
122 <button data-montage-id="disable-button" class="ss-disable-button nj-skinned"></button> 106 <button data-montage-id="disable-button" class="ss-disable-button nj-skinned"></button>
123 107
124 </div> 108 </div>
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 0ff195d5..a3326275 100644
--- a/js/panels/css-panel/style-sheet.reel/style-sheet.js
+++ b/js/panels/css-panel/style-sheet.reel/style-sheet.js
@@ -11,6 +11,10 @@ exports.StyleSheet = Montage.create(Component, {
11 _translateDistance: { 11 _translateDistance: {
12 value: null 12 value: null
13 }, 13 },
14 viewContainer : {
15 value: null,
16 serializable: true
17 },
14 18
15 prepareForDraw : { 19 prepareForDraw : {
16 value: function() { 20 value: function() {
@@ -43,14 +47,6 @@ exports.StyleSheet = Montage.create(Component, {
43 this.editView.style.removeProperty(transStr); 47 this.editView.style.removeProperty(transStr);
44 } 48 }
45 49
46 if(this._readOnly) {
47 this._element.classList.add('ss-locked');
48 this.importButton.element.classList.remove('ss-invisible');
49 } else {
50 this._element.classList.remove('ss-locked');
51 this.importButton.element.classList.add('ss-invisible');
52 }
53
54 if(this.default) { 50 if(this.default) {
55 this._element.classList.add('default-style-sheet'); 51 this._element.classList.add('default-style-sheet');
56 } else { 52 } else {
@@ -73,10 +69,7 @@ exports.StyleSheet = Montage.create(Component, {
73 var nonBlurringElements = [ 69 var nonBlurringElements = [
74 this.editView, 70 this.editView,
75 this.deleteButton.element, 71 this.deleteButton.element,
76 this.disableButton.element, 72 this.disableButton.element];
77 this.importButton.element];
78
79 console.log("handle mousedown");
80 73
81 if(nonBlurringElements.indexOf(e.target) === -1) { 74 if(nonBlurringElements.indexOf(e.target) === -1) {
82 this.editing = false; 75 this.editing = false;
@@ -112,7 +105,7 @@ exports.StyleSheet = Montage.create(Component, {
112 handleDeleteButtonAction : { 105 handleDeleteButtonAction : {
113 value: function(e) { 106 value: function(e) {
114 e.stopPropagation(); 107 e.stopPropagation();
115 debugger; 108 this.parentComponent.parentComponent.handleDeleteAction(this);
116 } 109 }
117 }, 110 },
118 111
@@ -208,6 +201,8 @@ exports.StyleSheet = Montage.create(Component, {
208 return this._source; 201 return this._source;
209 }, 202 },
210 set: function(sheet) { 203 set: function(sheet) {
204 if(!sheet || sheet === this._source) { return; }
205
211 console.log('sheet being set: ', this); 206 console.log('sheet being set: ', this);
212 207
213 this._extractData(sheet.ownerNode); 208 this._extractData(sheet.ownerNode);
diff --git a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
index 6e1638a6..bbefc69b 100644
--- a/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
+++ b/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html
@@ -11,16 +11,14 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
11 <script type="text/montage-serialization"> 11 <script type="text/montage-serialization">
12 { 12 {
13 "owner": { 13 "owner": {
14 "module" : "js/panels/css-panel/style-sheets-view.reel", 14 "prototype" : "js/panels/css-panel/style-sheets-view.reel",
15 "name" : "StyleSheet