From 1f8ee914686a0fac3e256b4f18683b83d591e6a6 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 17 May 2012 16:03:50 -0700 Subject: CSS Panel - declaration - sort objects when flag is set --- .../css-panel/style-declaration.reel/style-declaration.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/js/panels/css-panel/style-declaration.reel/style-declaration.js b/js/panels/css-panel/style-declaration.reel/style-declaration.js index 1ae1d6f4..61a65099 100644 --- a/js/panels/css-panel/style-declaration.reel/style-declaration.js +++ b/js/panels/css-panel/style-declaration.reel/style-declaration.js @@ -11,6 +11,7 @@ var Montage = require("montage/core/core").Montage, exports.StyleDeclaration = Montage.create(Component, { cssText : { value: null }, focusDelegate : { value: null }, + needsSort : { value: null }, includeEmptyStyle : { value: true, @@ -100,7 +101,7 @@ exports.StyleDeclaration = Montage.create(Component, { }, this); this._declaration = dec; - this.needsDraw = true; + this.needsDraw = this.needsSort = true; } }, @@ -267,6 +268,15 @@ exports.StyleDeclaration = Montage.create(Component, { } }, + willDraw : { + value: function() { + if(this.needsSort) { + this.arrayController.organizeObjects(); + this.needsSort = false; + } + } + }, + _containsElement : { value: function(innerElement) { var isInComponent = false, -- cgit v1.2.3