diff options
author | Valerio Virgillito | 2012-05-03 22:53:07 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-05-03 22:53:07 -0700 |
commit | 24b483db367291b72170f969de78efcb1a9b95bd (patch) | |
tree | a691a7803cefbfa76a6331a50cbeebcd16287d91 /node_modules/montage/ui/radio-button.reel | |
parent | dc93269cfa7c315d22d85c8217e2412749643f28 (diff) | |
download | ninja-24b483db367291b72170f969de78efcb1a9b95bd.tar.gz |
integrating the latest montage version
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'node_modules/montage/ui/radio-button.reel')
-rwxr-xr-x | node_modules/montage/ui/radio-button.reel/radio-button.js | 65 |
1 files changed, 63 insertions, 2 deletions
diff --git a/node_modules/montage/ui/radio-button.reel/radio-button.js b/node_modules/montage/ui/radio-button.reel/radio-button.js index b6f87205..450207a7 100755 --- a/node_modules/montage/ui/radio-button.reel/radio-button.js +++ b/node_modules/montage/ui/radio-button.reel/radio-button.js | |||
@@ -3,11 +3,19 @@ | |||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> |
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. |
5 | </copyright> */ | 5 | </copyright> */ |
6 | |||
7 | /** | ||
8 | @module "montage/ui/radio-button.reel" | ||
9 | @requires montage/ui/component | ||
10 | @requires montage/ui/check-input | ||
11 | */ | ||
6 | var Montage = require("montage").Montage, | 12 | var Montage = require("montage").Montage, |
7 | Component = require("ui/component").Component, | 13 | Component = require("ui/component").Component, |
8 | CheckInput = require("ui/check-input").CheckInput; | 14 | CheckInput = require("ui/check-input").CheckInput; |
9 | /** | 15 | /** |
10 | * The Text input | 16 | * Wraps the a <input type="radio"> element with binding support for the element's standard attributes. |
17 | @class module:"montage/ui/radio-button.reel".RadioButton | ||
18 | @extends module:montage/check-input.CheckInput | ||
11 | */ | 19 | */ |
12 | var RadioButton = exports.RadioButton = Montage.create(CheckInput, { | 20 | var RadioButton = exports.RadioButton = Montage.create(CheckInput, { |
13 | _fakeCheck: { | 21 | _fakeCheck: { |
@@ -36,6 +44,12 @@ var RadioButton = exports.RadioButton = Montage.create(CheckInput, { | |||
36 | enumerable: false, | 44 | enumerable: false, |
37 | value: null | 45 | value: null |
38 | }, | 46 | }, |
47 | |||
48 | /** | ||
49 | Specifies if the RadioButton is in its checked state or not. | ||
50 | @type {boolean} | ||
51 | @default false | ||
52 | */ | ||
39 | checked: { | 53 | checked: { |
40 | get: function() { | 54 | get: function() { |
41 | // If we haven't synced with the input field then our value is | 55 | // If we haven't synced with the input field then our value is |
@@ -95,13 +109,55 @@ var RadioButton = exports.RadioButton = Montage.create(CheckInput, { | |||
95 | } | 109 | } |
96 | } | 110 | } |
97 | }); | 111 | }); |
98 | RadioButton.addAttributes({ | 112 | RadioButton.addAttributes(/** @lends module:"montage/ui/radio-button.reel".RadioButton */ { |
113 | |||
114 | /** | ||
115 | Specifies whether the radio button should be focused as soon as the page is loaded. | ||
116 | @type {boolean} | ||
117 | @default false | ||
118 | */ | ||
99 | autofocus: {value: false, dataType: 'boolean'}, | 119 | autofocus: {value: false, dataType: 'boolean'}, |
120 | |||
121 | /** | ||
122 | When true, the radio button is disabled to user input and "disabled" is added to the element's CSS class list, allowing you to style the disabled control. | ||
123 | @type {boolean} | ||
124 | @default false | ||
125 | */ | ||
100 | disabled: {value: false, dataType: 'boolean'}, | 126 | disabled: {value: false, dataType: 'boolean'}, |
127 | |||
128 | /** | ||
129 | Specifies if the radio button is checked or not. | ||
130 | @type {boolean} | ||
131 | @default false | ||
132 | */ | ||
101 | checked: {value: false, dataType: 'boolean'}, | 133 | checked: {value: false, dataType: 'boolean'}, |
134 | |||
135 | /** | ||
136 | The value of the id attribute on the form with which to associate the radio button element. | ||
137 | @type string} | ||
138 | @default null | ||
139 | */ | ||
102 | form: null, | 140 | form: null, |
141 | |||
142 | /** | ||
143 | The name associated with the radio button's element. | ||
144 | @type {string} | ||
145 | @default null | ||
146 | */ | ||
103 | name: null, | 147 | name: null, |
148 | |||
149 | /** | ||
150 | Specifies whether or not the user can edit the radio button. | ||
151 | @type {boolean} | ||
152 | @default false | ||
153 | */ | ||
104 | readonly: {value: false, dataType: 'boolean'}, | 154 | readonly: {value: false, dataType: 'boolean'}, |
155 | |||
156 | /** | ||
157 | Advisory information for the element, rendered as the element's tooltip. | ||
158 | @type {string}, | ||
159 | @default null | ||
160 | */ | ||
105 | title: null, | 161 | title: null, |
106 | /* | 162 | /* |
107 | "On getting, if the element has a value attribute, it must return that | 163 | "On getting, if the element has a value attribute, it must return that |
@@ -109,5 +165,10 @@ RadioButton.addAttributes({ | |||
109 | it must set the element's value attribute to the new value." | 165 | it must set the element's value attribute to the new value." |
110 | http://www.w3.org/TR/html5/common-input-element-attributes.html#dom-input-value-default-on | 166 | http://www.w3.org/TR/html5/common-input-element-attributes.html#dom-input-value-default-on |
111 | */ | 167 | */ |
168 | /** | ||
169 | The value associated with the element. | ||
170 | @type {string} | ||
171 | @default "on" | ||
172 | */ | ||
112 | value: {value: 'on'} | 173 | value: {value: 'on'} |
113 | }); | 174 | }); |