From 73077acd7b5d9548539dccdf7a3e3c15af18a38a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 12 Jul 2012 16:55:41 -0700 Subject: adding a container around the breadcrumb button Signed-off-by: Valerio Virgillito --- .../bread-crumb-button.reel/bread-crumb-button.css | 30 +++++++++ .../bread-crumb-button.html | 75 ++++++++++++++++++++++ .../bread-crumb-button.reel/bread-crumb-button.js | 63 ++++++++++++++++++ .../layout/bread-crumb.reel/bread-crumb.html | 17 ++--- .../layout/bread-crumb.reel/bread-crumb.js | 2 +- 5 files changed, 174 insertions(+), 13 deletions(-) create mode 100755 js/components/layout/bread-crumb-button.reel/bread-crumb-button.css create mode 100755 js/components/layout/bread-crumb-button.reel/bread-crumb-button.html create mode 100755 js/components/layout/bread-crumb-button.reel/bread-crumb-button.js (limited to 'js') diff --git a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.css b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.css new file mode 100755 index 00000000..9d6c37a7 --- /dev/null +++ b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.css @@ -0,0 +1,30 @@ +/* +Copyright (c) 2012, Motorola Mobility LLC. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + */ diff --git a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.html b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.html new file mode 100755 index 00000000..6c881277 --- /dev/null +++ b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.html @@ -0,0 +1,75 @@ + + + + + + + + + + + + + +
+ +
+ + + diff --git a/js/components/layout/bread-crumb-button.reel/bread-crumb-button.js b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.js new file mode 100755 index 00000000..89df2fa0 --- /dev/null +++ b/js/components/layout/bread-crumb-button.reel/bread-crumb-button.js @@ -0,0 +1,63 @@ +/* +Copyright (c) 2012, Motorola Mobility LLC. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + */ + +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.BreadCrumbButton = Montage.create(Component, { + + _label: { + value: null + }, + + label: { + get: function() { + return this._label; + }, + set: function(value) { + this._label = value + } + }, + + _value: { + value: null + }, + + value: { + get: function() { + return this._value; + }, + set: function(value) { + this._value = value; + } + } +}); + diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.html b/js/components/layout/bread-crumb.reel/bread-crumb.html index 19707632..2c6d941f 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.html +++ b/js/components/layout/bread-crumb.reel/bread-crumb.html @@ -40,22 +40,15 @@ POSSIBILITY OF SUCH DAMAGE. "owner": { "prototype": "js/components/layout/bread-crumb.reel[Breadcrumb]", "properties": { - "element": {"#": "breadcrumbTrail"}, - "breadcrumbBt": {"@": "breadCrumbButton"} + "element": {"#": "breadcrumbTrail"} } }, - "breadCrumbButton": { - "prototype": "montage/ui/native/button.reel", + "breadcrumbButton": { + "prototype": "js/components/layout/bread-crumb-button.reel", "properties": { - "element": {"#": "breadcrumb_button"} + "element": {"#": "breadcrumbButton"} }, - "listeners": [ - { - "type": "action", - "listener": {"@": "owner"} - } - ], "bindings": { "label": {"<-": "@buttonsList.objectAtCurrentIteration.label"}, "value": {"<-": "@buttonsList.objectAtCurrentIteration.nodeUuid"} @@ -94,7 +87,7 @@ POSSIBILITY OF SUCH DAMAGE. diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index 40494bc3..efa0dfd5 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js @@ -87,7 +87,7 @@ exports.Breadcrumb = Montage.create(Component, { prepareForDraw: { value: function() { - this.breadcrumbBt.addEventListener("action", this, false); + this.addEventListener("action", this, false); this.addPropertyChangeListener("currentDocument.model.domContainer", this) } }, -- cgit v1.2.3