From 26683016ea28aac61e7c563df769dfafe40dce12 Mon Sep 17 00:00:00 2001 From: Eric Guzman Date: Wed, 30 May 2012 09:19:25 -0700 Subject: CSS Panel Toolbar - Prevent warning regarding undefined sourceObject --- js/components/toolbar.reel/toolbar-button.js | 28 ++++++++++++++++++++++++++++ js/components/toolbar.reel/toolbar.html | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 js/components/toolbar.reel/toolbar-button.js (limited to 'js/components') diff --git a/js/components/toolbar.reel/toolbar-button.js b/js/components/toolbar.reel/toolbar-button.js new file mode 100644 index 00000000..9ada9b29 --- /dev/null +++ b/js/components/toolbar.reel/toolbar-button.js @@ -0,0 +1,28 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage").Montage, + Component = require("montage/ui/component").Component, + Button = require("montage/ui/button.reel/button").Button; + +var ToolbarButton = exports.ToolbarButton = Montage.create(Button, { + hasTemplate : { + value: false + }, + _sourceObject : { + value: null + }, + sourceObject : { + get: function() { + return this._sourceObject; + }, + set: function(value) { + if(value === this._sourceObject) { return; } + + this._sourceObject = value; + } + } +}); \ No newline at end of file diff --git a/js/components/toolbar.reel/toolbar.html b/js/components/toolbar.reel/toolbar.html index d2c5972a..51e7ebec 100644 --- a/js/components/toolbar.reel/toolbar.html +++ b/js/components/toolbar.reel/toolbar.html @@ -30,7 +30,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot }, "button": { - "prototype": "montage/ui/button.reel", + "prototype": "js/components/toolbar.reel/toolbar-button", "properties": { "element": {"#": "button" }, "label": " " -- cgit v1.2.3