From 7f0dad901bef6512357a7a768fda1cb3106ac864 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Thu, 17 May 2012 19:55:18 -0700 Subject: CSS Panel - Fix style declaration interaction --- .../style-declaration.reel/style-declaration.html | 3 ++- .../style-declaration.reel/style-declaration.js | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'js/panels/css-panel/style-declaration.reel') 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 fced7d7a..5724ffc3 100644 --- a/js/panels/css-panel/style-declaration.reel/style-declaration.html +++ b/js/panels/css-panel/style-declaration.reel/style-declaration.html @@ -25,7 +25,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "bindings": { "content": { "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "styles" + "boundObjectPropertyPath": "styles", + "oneway": true } } }, 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 61a65099..c679783e 100644 --- a/js/panels/css-panel/style-declaration.reel/style-declaration.js +++ b/js/panels/css-panel/style-declaration.reel/style-declaration.js @@ -85,6 +85,13 @@ exports.StyleDeclaration = Montage.create(Component, { stylesArray = Array.prototype.slice.call(dec); + stylesArray.forEach(function(prop, index) { + this.styles.push({ + name: prop, + value: dec.getPropertyValue(prop) + }); + }, this); + if(this.includeEmptyStyle) { this.styles.push({ name : "property", @@ -93,13 +100,6 @@ exports.StyleDeclaration = Montage.create(Component, { }); } - stylesArray.forEach(function(prop, index) { - this.styles.push({ - name: prop, - value: dec.getPropertyValue(prop) - }); - }, this); - this._declaration = dec; this.needsDraw = this.needsSort = true; } @@ -218,7 +218,8 @@ exports.StyleDeclaration = Montage.create(Component, { } } - this.arrayController.addObjects(styleDescriptor); + this.styles.push(styleDescriptor); + this.arrayController.organizeObjects(); } }, -- cgit v1.2.3