/* 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.
*/ /*global require, exports*/ var Montage = require("montage").Montage, Component = require("ui/component").Component, NativeControl = require("ui/native-control").NativeControl, PressComposer = require("ui/composer/press-composer").PressComposer; /** * The Button input */ var Button = exports.Button = Montage.create(NativeControl, { /** @event @name action @param {Event} event Dispatched when the button is activated through a mouse click, finger tap, or when focused and the spacebar is pressed. */ /** @event @name hold @param {Event} event Dispatched when the button is pressed for a period of time, set by {@link holdTimeout}. */ /** Description TODO @private */ _preventFocus: { enumerable: false, value: false }, /** Description TODO @type {Function} @default {Boolean} false */ preventFocus: { get: function () { return this._preventFocus; }, set: function (value) { if (value === true) { this._preventFocus = true; } else { this._preventFocus = false; } } }, //TODO we should prefer positive properties like enabled vs disabled, get rid of disabled enabled: { dependencies: ["disabled"], get: function () { return !this._disabled; }, set: function (value) { this.disabled = !value; } }, /** The Montage converted used to convert or format values displayed by this Button instance. @type {Property} @default null */ converter: { value: null }, /** Stores the node that contains this button's value. Only used for non-`` elements. @private */ _labelNode: {value:undefined, enumerable: false}, _label: { value: undefined, enumerable: false }, /** The label for the button. In an `` element this is the value property. On any other element (including `