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 +++++++++++++++++--- 2 files changed, 20 insertions(+), 24 deletions(-) (limited to 'js/components/toolbar.reel') 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 : { -- cgit v1.2.3