aboutsummaryrefslogtreecommitdiff
path: root/js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
diff options
context:
space:
mode:
authorEric Guzman2012-03-02 10:55:51 -0800
committerEric Guzman2012-03-02 10:55:51 -0800
commit1433f2bdf2e5b8c5c18fed5e9c17fd983ab3606d (patch)
tree885ed3352f89e124bca7261d7c0edd4c95d3fff5 /js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js
parent53bdb1e7773069c4cca59e88d6da91cd0f58c94a (diff)
downloadninja-1433f2bdf2e5b8c5c18fed5e9c17fd983ab3606d.tar.gz
CSS Panel - Updating components, created toolbar components, and small changes to styles controller
Diffstat (limited to 'js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js')
-rw-r--r--js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js27
1 files changed, 23 insertions, 4 deletions
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 f8826b18..b1315311 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
@@ -11,6 +11,9 @@ exports.StyleSheetsView = Montage.create(Component, {
11 noDocumentCondition : { 11 noDocumentCondition : {
12 value: true 12 value: true
13 }, 13 },
14 showToolbar : {
15 value: false
16 },
14 styleSheets : { 17 styleSheets : {
15 value: [] 18 value: []
16 }, 19 },
@@ -24,18 +27,27 @@ exports.StyleSheetsView = Montage.create(Component, {
24 this.stylesController = this.application.ninja.stylesController; 27 this.stylesController = this.application.ninja.stylesController;
25 28
26 this.eventManager.addEventListener("styleSheetsReady", this, false); 29 this.eventManager.addEventListener("styleSheetsReady", this, false);
30 this.eventManager.addEventListener("newStyleSheet", this, false);
27 } 31 }
28 }, 32 },
33 _initView : {
34 value: false
35 },
29 handleStyleSheetsReady : { 36 handleStyleSheetsReady : {
30 value: function(e) { 37 value: function(e) {
31 this.noDocumentCondition = false; 38 this._initView = this.needsDraw = true;
32 39
33 this.stylesController.userStyleSheets.forEach(function(sheet) { 40// this.noDocumentCondition = false;
34 this.styleSheets.push(sheet); 41// this.showToolbar = true;
35 }, this); 42// this.styleSheets = this.stylesController.userStyleSheets;
36 43
37 } 44 }
38 }, 45 },
46 handleNewStyleSheet : {
47 value: function(e) {
48 this.styleSheets.push(e._event.detail);
49 }
50 },
39 prepareForDraw : { 51 prepareForDraw : {
40 value: function() { 52 value: function() {
41 console.log("style sheet view - prepare for draw"); 53 console.log("style sheet view - prepare for draw");
@@ -44,6 +56,13 @@ exports.StyleSheetsView = Montage.create(Component, {
44 draw : { 56 draw : {
45 value: function() { 57 value: function() {
46 console.log("styles sheet view - draw"); 58 console.log("styles sheet view - draw");
59
60 if(this._initView) {
61 this.noDocumentCondition = false;
62 this.showToolbar = true;
63 this.styleSheets = this.stylesController.userStyleSheets;
64 this._initView = false;
65 }
47 } 66 }
48 } 67 }
49}); \ No newline at end of file 68}); \ No newline at end of file