diff options
Diffstat (limited to 'js/panels/css-panel/style-sheets-view.reel')
-rw-r--r-- | js/panels/css-panel/style-sheets-view.reel/style-sheets-view.html | 25 | ||||
-rw-r--r-- | js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js | 8 |
2 files changed, 23 insertions, 10 deletions
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 78836f21..d1dbfa2b 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 | |||
@@ -16,22 +16,31 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
16 | "element" : {"#" : "style-sheet-view-container"} | 16 | "element" : {"#" : "style-sheet-view-container"} |
17 | } | 17 | } |
18 | }, | 18 | }, |
19 | "arrayController" : { | ||
20 | "module" : "montage/ui/controller/array-controller", | ||
21 | "name": "ArrayController", | ||
22 | "bindings": { | ||
23 | "content": { | ||
24 | "boundObject": {"@": "owner"}, | ||
25 | "boundObjectPropertyPath": "styleSheets", | ||
26 | "oneway": true | ||
27 | } | ||
28 | } | ||
29 | }, | ||
19 | "styleSheetList": { | 30 | "styleSheetList": { |
20 | "module" : "montage/ui/list.reel", | 31 | "module" : "montage/ui/list.reel", |
21 | "name": "List", | 32 | "name": "List", |
22 | "properties": { | 33 | "properties": { |
23 | "element": {"#": "sheet-list" } | 34 | "element": {"#": "sheet-list" }, |
24 | }, | 35 | "contentController": {"@": "arrayController"} |
25 | "bindings": { | ||
26 | "content": { | ||
27 | "boundObject": {"@": "owner" }, | ||
28 | "boundObjectPropertyPath": "styleSheets" | ||
29 | } | ||
30 | } | 36 | } |
31 | }, | 37 | }, |
32 | "sheet": { | 38 | "sheet": { |
33 | "module": "js/panels/css-panel/style-sheet.reel", | 39 | "module": "js/panels/css-panel/style-sheet.reel", |
34 | "name": "StyleSheet", | 40 | "name": "StyleSheet", |
41 | "properties": { | ||
42 | "element": {"#": "sheet-item"} | ||
43 | }, | ||
35 | "bindings": { | 44 | "bindings": { |
36 | "source": { | 45 | "source": { |
37 | "boundObject": {"@": "styleSheetList"}, | 46 | "boundObject": {"@": "styleSheetList"}, |
@@ -61,7 +70,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
61 | <div id="style-sheet-view-container" class="style-sheet-view-container"> | 70 | <div id="style-sheet-view-container" class="style-sheet-view-container"> |
62 | <h3 id="no-document-message">No document loaded. Please Open or Create a new document.</h3> | 71 | <h3 id="no-document-message">No document loaded. Please Open or Create a new document.</h3> |
63 | <ul id="sheet-list"> | 72 | <ul id="sheet-list"> |
64 | <li id="sheet-item"></li> | 73 | <li><div id="sheet-item"></div></li> |
65 | </ul> | 74 | </ul> |
66 | </div> | 75 | </div> |
67 | </body> | 76 | </body> |
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 f93de830..f8826b18 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 | |||
@@ -28,8 +28,12 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
28 | }, | 28 | }, |
29 | handleStyleSheetsReady : { | 29 | handleStyleSheetsReady : { |
30 | value: function(e) { | 30 | value: function(e) { |
31 | //this.styleSheets = null; | 31 | this.noDocumentCondition = false; |
32 | this.styleSheets = this.stylesController.userStyleSheets; | 32 | |
33 | this.stylesController.userStyleSheets.forEach(function(sheet) { | ||
34 | this.styleSheets.push(sheet); | ||
35 | }, this); | ||
36 | |||
33 | } | 37 | } |
34 | }, | 38 | }, |
35 | prepareForDraw : { | 39 | prepareForDraw : { |