From bbca3e05b39d43ce13c2f3e48cb33630ed7948b9 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 16 May 2012 14:14:25 -0700 Subject: CSS Panel - Added flag to draw method to improve perceived loading time --- .../rule-list-container.reel/rule-list-container.js | 12 ++++++++++++ js/panels/css-panel/rule-list.reel/rule-list.js | 3 +++ .../css-panel/style-declaration.reel/style-declaration.html | 3 +-- .../styles-view-container.reel/styles-view-container.js | 3 ++- 4 files changed, 18 insertions(+), 3 deletions(-) (limited to 'js/panels/css-panel') diff --git a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js index 50d69093..4ee340e4 100644 --- a/js/panels/css-panel/rule-list-container.reel/rule-list-container.js +++ b/js/panels/css-panel/rule-list-container.reel/rule-list-container.js @@ -11,6 +11,7 @@ exports.RuleListContainer = Montage.create(Component, { _instanceToAdd : { value: null }, _appendElement : { value: null }, _lastDisplayedList : { value: null }, + ruleListDrawn : { value: null }, _displayedList : { value: null }, displayedList : { @@ -157,5 +158,16 @@ exports.RuleListContainer = Montage.create(Component, { } } } + + }, + + didDraw: { + value: function() { + if(this.ruleListDrawn === true) { + var stylesView = this.parentComponent.parentComponent; + stylesView.needsDraw = stylesView.hasStyles = true; + } + + } } }); \ No newline at end of file diff --git a/js/panels/css-panel/rule-list.reel/rule-list.js b/js/panels/css-panel/rule-list.reel/rule-list.js index bca298df..b7244a2c 100644 --- a/js/panels/css-panel/rule-list.reel/rule-list.js +++ b/js/panels/css-panel/rule-list.reel/rule-list.js @@ -184,6 +184,9 @@ exports.RuleList = Montage.create(Component, { ///// Null out any rules that were just drawn this.rulesToDraw.length = 0; this.rulesToRemove.length = 0; + + this.parentComponent.ruleListDrawn = true; + this.parentComponent.needsDraw = true; } } }); diff --git a/js/panels/css-panel/style-declaration.reel/style-declaration.html b/js/panels/css-panel/style-declaration.reel/style-declaration.html index 2fdb11d5..f7415335 100644 --- a/js/panels/css-panel/style-declaration.reel/style-declaration.html +++ b/js/panels/css-panel/style-declaration.reel/style-declaration.html @@ -28,8 +28,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "bindings": { "content": { "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "styles", - "oneway": true + "boundObjectPropertyPath": "styles" } } }, diff --git a/js/panels/css-panel/styles-view-container.reel/styles-view-container.js b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js index 1372de0c..e6e836ad 100644 --- a/js/panels/css-panel/styles-view-container.reel/styles-view-container.js +++ b/js/panels/css-panel/styles-view-container.reel/styles-view-container.js @@ -41,7 +41,8 @@ exports.StylesViewContainer = Montage.create(Component, { }, set: function(hasThem) { this._hasStyles = hasThem; - this.needsDraw = true; + //caller needs to set ndt + //this.needsDraw = true; } }, -- cgit v1.2.3