From a8e97144c832e355de7f8177ce38644119248e87 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Mon, 21 May 2012 09:30:24 -0700 Subject: Style sheets view - Fixed drawing of toolbar and "no sheets" message --- .../style-sheets-view.reel/style-sheets-view.js | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'js/panels/css-panel/style-sheets-view.reel/style-sheets-view.js') 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, Component = require("montage/ui/component").Component; exports.StyleSheetsView = Montage.create(Component, { - noDocumentCondition : { value: true }, + documentLoaded : { value: false }, showToolbar : { value: false }, stylesController : { value: null }, styleSheets : { value: [] }, @@ -17,6 +17,22 @@ exports.StyleSheetsView = Montage.create(Component, { documentNameLabel : { value: null }, noDocumentLabelClass : { value: "no-document" }, + _activeDocument: { + value: null + }, + activeDocument : { + get: function() { + return this._activeDocument; + }, + set: function(value) { + if(value === this._activeDocument) { return;} + + this.documentLoaded = !!value; + + this._activeDocument = value; + } + }, + _documentName : { value: null }, documentName : { get: function() { @@ -99,6 +115,12 @@ exports.StyleSheetsView = Montage.create(Component, { this.documentName = this.stylesController.activeDocument.name; this.styleSheets = this.stylesController.userStyleSheets; + Object.defineBinding(this, 'activeDocument', { + 'boundObject': this.stylesController, + 'boundObjectPropertyPath': 'activeDocument', + 'oneway': true + }); + Object.defineBinding(this, 'defaultStyleSheet', { 'boundObject': this.stylesController, 'boundObjectPropertyPath': 'defaultStylesheet', -- cgit v1.2.3