From a3024011a91d3941f81481dd4d600e9684eb0fd4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 2 Feb 2012 00:11:51 -0800 Subject: upgrading to Montage v0.6 Signed-off-by: Valerio Virgillito --- .../ui/bluemoon/button-group.reel/button-group.css | 111 +++++++++++++++++++++ .../bluemoon/button-group.reel/button-group.html | 26 +++++ .../ui/bluemoon/button-group.reel/button-group.js | 77 ++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 node_modules/montage/ui/bluemoon/button-group.reel/button-group.css create mode 100644 node_modules/montage/ui/bluemoon/button-group.reel/button-group.html create mode 100644 node_modules/montage/ui/bluemoon/button-group.reel/button-group.js (limited to 'node_modules/montage/ui/bluemoon/button-group.reel') diff --git a/node_modules/montage/ui/bluemoon/button-group.reel/button-group.css b/node_modules/montage/ui/bluemoon/button-group.reel/button-group.css new file mode 100644 index 00000000..9491f3db --- /dev/null +++ b/node_modules/montage/ui/bluemoon/button-group.reel/button-group.css @@ -0,0 +1,111 @@ +/* + 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. +
*/ +.montage-button-group { + +} + +.montage-button-group.small > .montage-button, +.montage-button-group.small > .montage-button:before { + font-size: 12px; + border-radius: 16px; + padding: 1px 18px 0 18px; + height: 26px; + line-height: 26px; +} + +.montage-button-group.small > .montage-button.submit, +.montage-button-group.small > .montage-button.cancel { + height: 21px; + line-height: 21px; +} + +.montage-button-group.small > .montage-button.disabled, +.montage-button-group.small > .montage-button.disabled:before { + height: 28px; + line-height: 28px; +} + +.montage-button-group.small > .montage-button.submit:before, +.montage-button-group.small > .montage-button.cancel:before { + height: 24px; +} + +.montage-button-group > .montage-button.submit, +.montage-button-group > .montage-button.cancel { + height: 42px; + line-height: 42px; +} + +.montage-button-group > .montage-button:not(:first-child):not(:last-child), +.montage-button-group > .montage-button.submit:not(:first-child):not(:last-child), +.montage-button-group > .montage-button.cancel:not(:first-child):not(:last-child), +.montage-button-group > .montage-button:not(:first-child):not(:last-child):before, +.montage-button-group > .montage-button:not(:first-child):not(:last-child):after { + border-radius: 0; +} + +.montage-button-group > .montage-button:first-child:not(:last-child), +.montage-button-group > .montage-button.submit:first-child:not(:last-child), +.montage-button-group > .montage-button.cancel:first-child:not(:last-child), +.montage-button-group > .montage-button:first-child:not(:last-child):before, +.montage-button-group > .montage-button:first-child:not(:last-child):after { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.montage-button-group > .montage-button:last-child:not(:first-child), +.montage-button-group > .montage-button.submit:last-child:not(:first-child), +.montage-button-group > .montage-button.cancel:last-child:not(:first-child), +.montage-button-group > .montage-button:last-child:not(:first-child):before, +.montage-button-group > .montage-button:last-child:not(:first-child):after { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.montage-button-group > .montage-button:not(:first-child) { + margin-left: -3px; +} + +/* Icon handling */ + +.montage-button-group.small > .montage-button.text.icon > img, +.montage-button-group.small > .montage-button.submit.icon > img, +.montage-button-group.small > .montage-button.cancel.icon > img { + float: left; + margin-left: -4px; + margin-right: 4px; + margin-top: 0; + height: 20px; + width: 20px; +} + +.montage-button-group.small > .montage-button.text.icon > img { + margin-top: 2px; +} + +.montage-button-group.iconic > .montage-button.text.icon, +.montage-button-group.iconic > .montage-button.submit.icon, +.montage-button-group.iconic > .montage-button.cancel.icon { + text-indent: -9999px; + width: 26px; + padding-left: 14px; + padding-right: 14px; +} + +.montage-button-group.small.iconic > .montage-button.text.icon, +.montage-button-group.small.iconic > .montage-button.submit.icon, +.montage-button-group.small.iconic > .montage-button.cancel.icon { + width: 20px; + padding-left: 10px; + padding-right: 10px; +} + +.montage-button-group.iconic > .montage-button.text.icon > img, +.montage-button-group.iconic > .montage-button.submit.icon > img, +.montage-button-group.iconic > .montage-button.cancel.icon > img { + margin-left: 0; + margin-right: 0; +} diff --git a/node_modules/montage/ui/bluemoon/button-group.reel/button-group.html b/node_modules/montage/ui/bluemoon/button-group.reel/button-group.html new file mode 100644 index 00000000..4bda1401 --- /dev/null +++ b/node_modules/montage/ui/bluemoon/button-group.reel/button-group.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/node_modules/montage/ui/bluemoon/button-group.reel/button-group.js b/node_modules/montage/ui/bluemoon/button-group.reel/button-group.js new file mode 100644 index 00000000..6f69744f --- /dev/null +++ b/node_modules/montage/ui/bluemoon/button-group.reel/button-group.js @@ -0,0 +1,77 @@ +/* + 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. +
*/ +/** + @module "montage/ui/bluemoon/button-group.reel" + @requires montage/core/core + @requires "ui/component-group.reel" +*/ +var Montage = require("montage").Montage, + ComponentGroup = require("ui/component-group.reel").ComponentGroup; + +/** + @class module:"montage/ui/bluemoon/button-group.reel".ButtonGroup + @classdesc A group of buttons, displayed "pill" style. + @extends module:montage/ui/component.Component + */ +var ButtonGroup = exports.ButtonGroup = Montage.create(ComponentGroup, /** @lends module:"montage/ui/bluemoon/button-group.reel".ButtonGroup */ { +/** + Description TODO + @type {Boolean} + @default true +*/ + hasTemplate: { + value: true + }, + +/** + Description TODO + @private +*/ + _iconic: { + value: false + }, + + /** + Sets wether or not to hide button text for buttons with icons. + @type {Function} + @default {Boolean} false + */ + iconic: { + get: function() { + return this._iconic; + }, + set: function(value) { + if (this._iconic !== value) { + this._iconic = value; + this.needsDraw = true; + } + } + }, + +/** + Description TODO + @function + */ + prepareForDraw: { + value: function() { + this.element.classList.add("montage-button-group"); + } + }, + +/** + Description TODO + @function + */ + draw: { + value: function() { + if (this._iconic) { + this.element.classList.add("iconic"); + } else { + this.element.classList.remove("iconic"); + } + } + } +}); -- cgit v1.2.3