From 1c3da2901f454ad2c18e20216bb2517740a1c080 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Tue, 22 May 2012 14:28:00 -0700 Subject: CSS Panel - Update components to use new serialization format --- js/components/toolbar.reel/toolbar.html | 24 ++----------- js/components/toolbar.reel/toolbar.js | 20 +++++++++-- js/data/panels-data.js | 2 +- js/panels/css-panel/css-panel-container.js | 2 +- js/panels/css-panel/css-panel.reel/css-panel.html | 21 ++++-------- js/panels/css-panel/css-panel.reel/css-panel.js | 2 +- js/panels/css-panel/css-style.reel/css-style.html | 32 +++++------------ .../css-style-rule.reel/css-style-rule.html | 40 ++++++---------------- .../rule-list-container.html | 11 +++--- js/panels/css-panel/rule-list.reel/rule-list.html | 3 +- .../style-declaration.reel/style-declaration.html | 35 ++++--------------- .../css-panel/style-sheet.reel/style-sheet.html | 24 ++++--------- .../style-sheets-view.reel/style-sheets-view.html | 18 ++-------- .../styles-view-container.html | 24 ++++--------- js/panels/css-panel/styles-view-delegate.js | 2 +- 15 files changed, 78 insertions(+), 182 deletions(-) (limited to 'js') diff --git a/js/components/toolbar.reel/toolbar.html b/js/components/toolbar.reel/toolbar.html index b33c4665..d2c5972a 100644 --- a/js/components/toolbar.reel/toolbar.html +++ b/js/components/toolbar.reel/toolbar.html @@ -25,12 +25,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "element": {"#": "repetition"} }, "bindings": { - "objects" : { - "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "buttons", - "oneway": true - } - + "objects": {"<-": "@owner.buttons"} } }, @@ -41,21 +36,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "label": " " }, "bindings": { - "label" : { - "boundObject": {"@": "buttonList"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.title", - "oneway": true - }, - "identifier": { - "boundObject": {"@": "buttonList"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.identifier", - "oneway": true - }, - "sourceObject": { - "boundObject": {"@": "buttonList"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - } + "label": {"<-": "@buttonList.objectAtCurrentIteration.title"}, + "sourceObject": {"<-": "@buttonList.objectAtCurrentIteration"} } } } diff --git a/js/components/toolbar.reel/toolbar.js b/js/components/toolbar.reel/toolbar.js index 8f93aa2b..2ccdb2c5 100644 --- a/js/components/toolbar.reel/toolbar.js +++ b/js/components/toolbar.reel/toolbar.js @@ -11,17 +11,31 @@ exports.Toolbar = Montage.create(Component, { _needsButtonProperties : { value: null }, + _sourceObject : { + value: null + }, + sourceObject : { + get: function() { + return this._sourceObject; + }, + set: function(value) { + if(value === this._sourceObject) { return; } + this._sourceObject = value; + }, + serializable: true + }, leftAlignClass : { value: "left-button" }, hideButtonClass : { value: "hide-button" }, - _buttons : { value: null }, + _buttons : { value: [], distinct: true }, buttons : { get: function() { return this._buttons; }, set: function(btns) { this._buttons = btns; - this._needsButtonProperties = this.needsDraw = true;; - } + this._needsButtonProperties = this.needsDraw = true; + }, + serializable: true }, _buttonToHide : { diff --git a/js/data/panels-data.js b/js/data/panels-data.js index ed346196..ffc76782 100644 --- a/js/data/panels-data.js +++ b/js/data/panels-data.js @@ -80,7 +80,7 @@ exports.PanelsData = Montage.create(Montage, { collapsed: false, open: true, modulePath: "js/panels/css-panel/css-panel.reel", - moduleName: "CSSPanelNew" + moduleName: "CssPanel" }, { name: "Presets", diff --git a/js/panels/css-panel/css-panel-container.js b/js/panels/css-panel/css-panel-container.js index 6110c999..08673309 100644 --- a/js/panels/css-panel/css-panel-container.js +++ b/js/panels/css-panel/css-panel-container.js @@ -6,7 +6,7 @@ var Montage = require("montage/core/core").Montage; var PanelBase = require("js/panels/PanelBase").PanelBase; -var Content = require("js/panels/css-panel/css-panel.reel").CSSPanelNew; +var Content = require("js/panels/css-panel/css-panel.reel").CssPanel; exports.CSSPanelContainer = Montage.create(PanelBase, { panelName : { value: "CSS Panel" }, diff --git a/js/panels/css-panel/css-panel.reel/css-panel.html b/js/panels/css-panel/css-panel.reel/css-panel.html index 54bb1fae..42dca8a2 100644 --- a/js/panels/css-panel/css-panel.reel/css-panel.html +++ b/js/panels/css-panel/css-panel.reel/css-panel.html @@ -11,8 +11,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
-