diff options
author | Eric Guzman | 2012-05-21 09:30:24 -0700 |
---|---|---|
committer | Eric Guzman | 2012-05-21 09:30:24 -0700 |
commit | a8e97144c832e355de7f8177ce38644119248e87 (patch) | |
tree | 14d7c03648347019b34c37f789c48d5554d77f1e /js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js | |
parent | 84097be9d7dd3403a0ac12f8c039d3ffc5281cfc (diff) | |
download | ninja-a8e97144c832e355de7f8177ce38644119248e87.tar.gz |
Style sheets view - Fixed drawing of toolbar and "no sheets" message
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.js | 24 |
1 files changed, 23 insertions, 1 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 d6ec5349..28b094a7 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 | |||
@@ -8,7 +8,7 @@ var Montage = require("montage/core/core").Montage, | |||
8 | Component = require("montage/ui/component").Component; | 8 | Component = require("montage/ui/component").Component; |
9 | 9 | ||
10 | exports.StyleSheetsView = Montage.create(Component, { | 10 | exports.StyleSheetsView = Montage.create(Component, { |
11 | noDocumentCondition : { value: true }, | 11 | documentLoaded : { value: false }, |
12 | showToolbar : { value: false }, | 12 | showToolbar : { value: false }, |
13 | stylesController : { value: null }, | 13 | stylesController : { value: null }, |
14 | styleSheets : { value: [] }, | 14 | styleSheets : { value: [] }, |
@@ -17,6 +17,22 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
17 | documentNameLabel : { value: null }, | 17 | documentNameLabel : { value: null }, |
18 | noDocumentLabelClass : { value: "no-document" }, | 18 | noDocumentLabelClass : { value: "no-document" }, |
19 | 19 | ||
20 | _activeDocument: { | ||
21 | value: null | ||
22 | }, | ||
23 | activeDocument : { | ||
24 | get: function() { | ||
25 | return this._activeDocument; | ||
26 | }, | ||
27 | set: function(value) { | ||
28 | if(value === this._activeDocument) { return;} | ||
29 | |||
30 | this.documentLoaded = !!value; | ||
31 | |||
32 | this._activeDocument = value; | ||
33 | } | ||
34 | }, | ||
35 | |||
20 | _documentName : { value: null }, | 36 | _documentName : { value: null }, |
21 | documentName : { | 37 | documentName : { |
22 | get: function() { | 38 | get: function() { |
@@ -99,6 +115,12 @@ exports.StyleSheetsView = Montage.create(Component, { | |||
99 | this.documentName = this.stylesController.activeDocument.name; | 115 | this.documentName = this.stylesController.activeDocument.name; |
100 | this.styleSheets = this.stylesController.userStyleSheets; | 116 | this.styleSheets = this.stylesController.userStyleSheets; |
101 | 117 | ||
118 | Object.defineBinding(this, 'activeDocument', { | ||
119 | 'boundObject': this.stylesController, | ||
120 | 'boundObjectPropertyPath': 'activeDocument', | ||
121 | 'oneway': true | ||
122 | }); | ||
123 | |||
102 | Object.defineBinding(this, 'defaultStyleSheet', { | 124 | Object.defineBinding(this, 'defaultStyleSheet', { |
103 | 'boundObject': this.stylesController, | 125 | 'boundObject': this.stylesController, |
104 | 'boundObjectPropertyPath': 'defaultStylesheet', | 126 | 'boundObjectPropertyPath': 'defaultStylesheet', |