sproutcore 1.5.0.rc.1 → 1.5.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. data/CHANGELOG +4 -0
  2. data/VERSION.yml +1 -1
  3. data/lib/frameworks/sproutcore/Buildfile +9 -4
  4. data/lib/frameworks/sproutcore/README.md +1 -0
  5. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Preview.pdf +0 -0
  6. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Thumbnail.tiff +0 -0
  7. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/data.plist +0 -0
  8. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image10.png +0 -0
  9. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image11.png +0 -0
  10. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image13.png +0 -0
  11. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image15.png +0 -0
  12. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image16.png +0 -0
  13. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image17.png +0 -0
  14. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image18.png +0 -0
  15. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image19.png +0 -0
  16. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image22.tiff +0 -0
  17. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image23.png +0 -0
  18. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image24.png +0 -0
  19. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image25.png +0 -0
  20. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image30.png +0 -0
  21. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image31.png +0 -0
  22. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image8.png +0 -0
  23. data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image9.png +0 -0
  24. data/lib/frameworks/sproutcore/frameworks/animation/core.js +23 -25
  25. data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +160 -0
  26. data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +73 -82
  27. data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +1 -3
  28. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/bind.js +110 -7
  29. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/collection.js +10 -7
  30. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/localization.js +1 -1
  31. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/view.js +4 -2
  32. data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions.js → core_foundation/ext/handlebars.js} +0 -57
  33. data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/object.js +1 -3
  34. data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +11 -0
  35. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +1 -3
  36. data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +2 -4
  37. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +14 -16
  38. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/builder.js +29 -37
  39. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/datetime.js +0 -0
  40. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +71 -19
  41. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +3 -7
  42. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +5 -7
  43. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +1 -3
  44. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +4 -0
  45. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +21 -27
  46. data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +3 -5
  47. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +3 -3
  48. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_enumerable_case.js +1 -1
  49. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +1 -1
  50. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +93 -1
  51. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +1 -1
  52. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js +13 -11
  53. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +2 -6
  54. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +4 -4
  55. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/theme.js +2 -0
  56. data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +4 -4
  57. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +6 -2
  58. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +87 -32
  59. data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +21 -25
  60. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +15 -19
  61. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +114 -167
  62. data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +4 -4
  63. data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +4 -6
  64. data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +2 -4
  65. data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +7 -7
  66. data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +18 -20
  67. data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +74 -72
  68. data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +36 -29
  69. data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +2 -2
  70. data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +97 -78
  71. data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +117 -97
  72. data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +13 -13
  73. data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +111 -108
  74. data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +231 -198
  75. data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +146 -145
  76. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +21 -21
  77. data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +49 -50
  78. data/lib/frameworks/sproutcore/frameworks/datetime/{system → frameworks/core/system}/datetime.js +122 -171
  79. data/lib/frameworks/sproutcore/frameworks/datetime/{tests → frameworks/core/tests}/system/datetime.js +0 -0
  80. data/lib/frameworks/sproutcore/frameworks/datetime/{resources → frameworks/localized/resources}/strings.js +0 -0
  81. data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +91 -0
  82. data/lib/frameworks/sproutcore/frameworks/desktop/core.js +18 -2
  83. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +23 -16
  84. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +56 -45
  85. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +5 -2
  86. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +21 -19
  87. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +82 -77
  88. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +18 -12
  89. data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +29 -17
  90. data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +148 -107
  91. data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +31 -16
  92. data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +16 -13
  93. data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +38 -17
  94. data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +37 -25
  95. data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +247 -144
  96. data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +155 -100
  97. data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +39 -17
  98. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +9 -6
  99. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +18 -22
  100. data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +27 -17
  101. data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +77 -44
  102. data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +68 -33
  103. data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +168 -110
  104. data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +37 -5
  105. data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +187 -123
  106. data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +73 -49
  107. data/lib/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +34 -9
  108. data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +51 -14
  109. data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +38 -8
  110. data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +15 -9
  111. data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +54 -34
  112. data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +113 -42
  113. data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +84 -28
  114. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +67 -51
  115. data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +122 -35
  116. data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation.js +40 -16
  117. data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +28 -18
  118. data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +27 -31
  119. data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +118 -68
  120. data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +117 -61
  121. data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +23 -16
  122. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +241 -77
  123. data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +134 -69
  124. data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +107 -25
  125. data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +125 -48
  126. data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +165 -69
  127. data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +73 -24
  128. data/lib/frameworks/sproutcore/frameworks/desktop/views/separator.js +19 -5
  129. data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list.js +16 -4
  130. data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +14 -7
  131. data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +43 -37
  132. data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +8 -1
  133. data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +14 -3
  134. data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +16 -2
  135. data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +99 -0
  136. data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +13 -1
  137. data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +58 -8
  138. data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +34 -18
  139. data/lib/frameworks/sproutcore/frameworks/desktop/views/well.js +25 -9
  140. data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +70 -36
  141. data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +10 -5
  142. data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +28 -17
  143. data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +41 -43
  144. data/lib/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +42 -4
  145. data/lib/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +94 -4
  146. data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +41 -1
  147. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +2 -0
  148. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +18 -9
  149. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +7 -5
  150. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +7 -8
  151. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +34 -24
  152. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +48 -18
  153. data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +1 -0
  154. data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/misc.js +1 -2
  155. data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +1 -1
  156. data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +0 -11
  157. data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +1 -1
  158. data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +8 -0
  159. data/lib/frameworks/sproutcore/frameworks/qunit/README.md +24 -0
  160. data/lib/frameworks/sproutcore/frameworks/qunit/package.json +21 -0
  161. data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.css +215 -0
  162. data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.js +1442 -0
  163. data/lib/frameworks/sproutcore/frameworks/qunit/test/headless.html +24 -0
  164. data/lib/frameworks/sproutcore/frameworks/qunit/test/index.html +18 -0
  165. data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.html +17 -0
  166. data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.js +150 -0
  167. data/lib/frameworks/sproutcore/frameworks/qunit/test/same.js +1421 -0
  168. data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +314 -0
  169. data/lib/frameworks/sproutcore/frameworks/runtime/core.js +1 -1
  170. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +369 -60
  171. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +2 -405
  172. data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +3 -9
  173. data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +50 -45
  174. data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +20 -1
  175. data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -9
  176. data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +1 -1
  177. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +36 -14
  178. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +0 -34
  179. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable_observers.js +50 -61
  180. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +2 -2
  181. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
  182. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +45 -1
  183. data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -1
  184. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +5 -0
  185. data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +1 -1
  186. data/lib/frameworks/sproutcore/frameworks/testing/core.js +3 -0
  187. data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +0 -1
  188. data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +0 -1
  189. data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -1
  190. data/vendor/chance/lib/chance/instance.rb +8 -6
  191. metadata +41 -31
  192. data/lib/frameworks/sproutcore/frameworks/testing/jquery.js +0 -3559
  193. data/lib/frameworks/sproutcore/frameworks/testing/qunit.js +0 -827
@@ -5,6 +5,8 @@
5
5
  // License: Licensed under MIT license (see license.js)
6
6
  // ==========================================================================
7
7
 
8
+ sc_require('views/button');
9
+
8
10
  /**
9
11
  @class
10
12
 
@@ -13,33 +15,32 @@
13
15
  Clicking the SelectView button displays a menu pane with a
14
16
  list of items. The selected item will be displayed on the button.
15
17
  User has the option of enabling checkbox for the selected menu item.
16
-
17
- I AM CHANGING THIS AND BREAKING APIs, so I have renamed it (and put it in a more
18
- logical place) so that I don't break anyone else's current use of SelectButtonView...
19
- even though I have a suspiscion that no one uses it.
20
18
 
21
19
  @extends SC.ButtonView
22
20
  @version 1.0
23
21
  @author Alex Iskander, Mohammed Ashik
24
22
  */
25
- sc_require('views/button');
26
-
27
23
  SC.SelectView = SC.ButtonView.extend(
28
24
  /** @scope SC.SelectView.prototype */ {
29
- /**
30
- An array of items that will be form the menu you want to show.
31
25
 
32
- @property
33
- @type {Array}
26
+ /**
27
+ @field
28
+ @type Boolean
29
+ @default YES
34
30
  */
35
- items: [],
31
+ acceptsFirstResponder: function() {
32
+ return this.get('isEnabled');
33
+ }.property('isEnabled'),
36
34
 
37
35
  /**
38
- Binding default for an array of items
36
+ An array of items that will be form the menu you want to show.
39
37
 
40
- @property
41
- @default SC.Binding.multiple()
38
+ @type Array
39
+ @default []
42
40
  */
41
+ items: [],
42
+
43
+ /** @private */
43
44
  itemsBindingDefault: SC.Binding.multiple(),
44
45
 
45
46
  /**
@@ -47,9 +48,8 @@ SC.SelectView = SC.ButtonView.extend(
47
48
  menu item will be pulled from the object using the named property.
48
49
  if this is null, the collection items themselves will be used.
49
50
 
50
- @property
51
- @type {String}
52
- @default: null
51
+ @type String
52
+ @default null
53
53
  */
54
54
  itemTitleKey: null,
55
55
 
@@ -58,9 +58,8 @@ SC.SelectView = SC.ButtonView.extend(
58
58
  be used to sort the items. If this is not set, then itemTitleKey will
59
59
  be used.
60
60
 
61
- @property
62
- @type: {String}
63
- @default: null
61
+ @type String
62
+ @default null
64
63
  */
65
64
  itemSortKey: null,
66
65
 
@@ -69,32 +68,37 @@ SC.SelectView = SC.ButtonView.extend(
69
68
  as the value for the options popup. If you don't set this, then the
70
69
  items themselves will be used as the value.
71
70
 
72
- @property
73
- @type {String}
71
+ @type String
74
72
  @default null
75
73
  */
76
74
  itemValueKey: null,
77
75
 
78
76
  /**
79
77
  Key used to extract icons from the items array
78
+
79
+ @type String
80
+ @default null
80
81
  */
81
82
  itemIconKey: null,
82
83
 
83
84
  /**
84
85
  Key to use to identify separators.
86
+
87
+ @type String
88
+ @default "separator"
85
89
  */
86
90
  itemSeparatorKey: "separator",
87
91
 
88
92
  /**
89
93
  Key used to indicate if the item is to be enabled.
94
+
95
+ @type String
96
+ @default "isEnabled"
90
97
  */
91
98
  itemIsEnabledKey: "isEnabled",
92
99
 
93
100
  /**
94
- If true, the empty name will be localized.
95
-
96
- @property
97
- @type {Boolean}
101
+ @type Boolean
98
102
  @default YES
99
103
  */
100
104
  localize: YES,
@@ -103,21 +107,22 @@ SC.SelectView = SC.ButtonView.extend(
103
107
  if true, it means that no sorting will occur, items will appear
104
108
  in the same order as in the array
105
109
 
106
- @property
107
- @type {Boolean}
110
+ @type Boolean
108
111
  @default YES
109
112
  */
110
113
  disableSort: YES,
111
114
 
112
115
  /**
113
-
114
- @property
116
+ @type Array
115
117
  @default ['sc-select-button']
118
+ @see SC.View#classNames
116
119
  */
117
120
  classNames: ['sc-select-view'],
118
121
 
119
122
  /**
120
123
  Menu attached to the SelectView.
124
+
125
+ @type SC.View
121
126
  @default SC.MenuView
122
127
  */
123
128
  menu: null,
@@ -136,7 +141,7 @@ SC.SelectView = SC.ButtonView.extend(
136
141
  is used to calculate the preferMatrix.
137
142
 
138
143
  @property
139
- @type {Number}
144
+ @type Number
140
145
  @default null
141
146
  @private
142
147
  */
@@ -145,16 +150,16 @@ SC.SelectView = SC.ButtonView.extend(
145
150
  /**
146
151
  Current Value of the SelectView
147
152
 
148
- @property
153
+ @type Object
149
154
  @default null
150
155
  */
151
- value: null ,
156
+ value: null,
152
157
 
153
158
  /**
154
159
  if this property is set to 'YES', a checbox is shown next to the
155
160
  selected menu item.
156
161
 
157
- @private
162
+ @type Boolean
158
163
  @default YES
159
164
  */
160
165
  checkboxEnabled: YES,
@@ -163,7 +168,7 @@ SC.SelectView = SC.ButtonView.extend(
163
168
  if this property is set to 'YES', a checbox is shown next to the
164
169
  selected menu item.
165
170
 
166
- @private
171
+ @type Boolean
167
172
  @default YES
168
173
  */
169
174
  showCheckbox: YES,
@@ -193,17 +198,18 @@ SC.SelectView = SC.ButtonView.extend(
193
198
  _defaultIcon: null,
194
199
 
195
200
  /**
196
- @private
197
-
198
201
  The button theme will be popup
202
+
203
+ @type String
204
+ @default 'popup'
205
+ @readOnly
199
206
  */
200
207
  theme: 'popup',
201
208
 
202
209
  /**
203
- Render method gets triggered when these properties change
204
-
205
- @property
206
- @type{SC.Array}
210
+ @type SC.Array
211
+ @default ['icon', 'value','controlSize','items']
212
+ @see SC.View#displayProperties
207
213
  */
208
214
  displayProperties: ['icon', 'value','controlSize','items'],
209
215
 
@@ -213,10 +219,8 @@ SC.SelectView = SC.ButtonView.extend(
213
219
  the button. The value at the second index(0) changes based on the
214
220
  postion(index) of the menu item in the menu pane.
215
221
 
216
- @property
217
- @type {Array}
222
+ @type Array
218
223
  @default null
219
-
220
224
  */
221
225
  preferMatrix: null,
222
226
 
@@ -224,8 +228,7 @@ SC.SelectView = SC.ButtonView.extend(
224
228
  Property to set the menu item height. This in turn is used for
225
229
  the calculation of prefMatrix.
226
230
 
227
- @property
228
- @type {Number}
231
+ @type Number
229
232
  @default 20
230
233
  */
231
234
  CUSTOM_MENU_ITEM_HEIGHT: 20,
@@ -241,7 +244,7 @@ SC.SelectView = SC.ButtonView.extend(
241
244
  If this property is set to 'YES', the menu pane will be positioned
242
245
  below the anchor.
243
246
 
244
- @private
247
+ @type Boolean
245
248
  @default NO
246
249
  */
247
250
  isDefaultPosition: NO,
@@ -256,18 +259,24 @@ SC.SelectView = SC.ButtonView.extend(
256
259
 
257
260
  /**
258
261
  Example view used for menu items.
262
+
263
+ @type SC.View
264
+ @default null
259
265
  */
260
266
  exampleView: null,
261
267
 
262
268
  /**
263
269
  customView menu offset width
270
+
271
+ @type Number
272
+ @default 0
264
273
  */
265
274
  customViewMenuOffsetWidth: 0,
266
275
 
267
276
  /**
268
277
  This is a property for enabling/disabling ellipsis
269
278
 
270
- @private
279
+ @type Boolean
271
280
  @default YES
272
281
  */
273
282
  needsEllipsis: YES,
@@ -276,19 +285,23 @@ SC.SelectView = SC.ButtonView.extend(
276
285
  This property allows you at add extra padding to the height
277
286
  of the menu pane.
278
287
 
288
+ @type Number
279
289
  @default 0
280
- @property {Number} heightPadding for menu pane.
281
290
  */
282
291
  menuPaneHeightPadding: 0,
283
292
 
284
293
  /**
285
- The amount of space to add to the calculated width of the menu item strings to
286
- determine the width of the menu pane.
294
+ The amount of space to add to the calculated width of the menu item strings to
295
+ determine the width of the menu pane.
296
+
297
+ @type Number
298
+ @default 35
287
299
  */
288
300
  menuItemPadding: 35,
289
301
 
290
302
  /**
291
- Disable context menu.
303
+ @type Boolean
304
+ @default NO
292
305
  */
293
306
  isContextMenuEnabled: NO,
294
307
 
@@ -296,7 +309,9 @@ SC.SelectView = SC.ButtonView.extend(
296
309
  This is a property to enable/disable focus rings in buttons.
297
310
  For select_button, we are making it a default.
298
311
 
312
+ @type Boolean
299
313
  @default YES
314
+ @see SC.ButtonView#supportFocusRing
300
315
  */
301
316
  supportFocusRing: YES,
302
317
 
@@ -325,8 +340,8 @@ SC.SelectView = SC.ButtonView.extend(
325
340
  override this method to implement your own sorting of the menu. By
326
341
  default, menu items are sorted using the value shown or the sortKey
327
342
 
328
- @param{SC.Array} objects the unsorted array of objects to display.
329
- @returns sorted array of objects
343
+ @param {SC.Array} objects the unsorted array of objects to display.
344
+ @returns {SC.Array} sorted array of objects
330
345
  */
331
346
  sortObjects: function(objects) {
332
347
  if(!this.get('disableSort')){
@@ -470,8 +485,6 @@ SC.SelectView = SC.ButtonView.extend(
470
485
  },
471
486
 
472
487
  /**
473
- Button action handler
474
-
475
488
  @private
476
489
  @param {DOMMouseEvent} evt mouseup event that triggered the action
477
490
  */
@@ -612,9 +625,8 @@ SC.SelectView = SC.ButtonView.extend(
612
625
  return YES ;
613
626
  },
614
627
 
615
- /**
628
+ /** @private
616
629
  Action method for the select button menu items
617
-
618
630
  */
619
631
  displaySelectedItem: function(menuView) {
620
632
  var currentItem = menuView.get("selectedItem");
@@ -624,7 +636,7 @@ SC.SelectView = SC.ButtonView.extend(
624
636
  this.set("_itemIdx", currentItem.get("contentIndex"));
625
637
  },
626
638
 
627
- /**
639
+ /** @private
628
640
  Set the "top" attribute in the prefer matrix property which will
629
641
  position menu such that the selected item in the menu will be
630
642
  place aligned to the item on the button when menu is opened.
@@ -674,7 +686,6 @@ SC.SelectView = SC.ButtonView.extend(
674
686
 
675
687
  /**
676
688
  @private
677
-
678
689
  Holding down the button should display the menu pane.
679
690
  */
680
691
  mouseDown: function(evt) {
@@ -730,7 +741,7 @@ SC.SelectView = SC.ButtonView.extend(
730
741
  return YES;
731
742
  },
732
743
 
733
- /**
744
+ /** @private
734
745
  Override mouseExited to not remove the active state on mouseexit.
735
746
  */
736
747
  mouseExited: function() {
@@ -739,7 +750,6 @@ SC.SelectView = SC.ButtonView.extend(
739
750
 
740
751
  /**
741
752
  @private
742
-
743
753
  Handle Key event - Down arrow key
744
754
  */
745
755
  keyDown: function(event) {
@@ -753,7 +763,6 @@ SC.SelectView = SC.ButtonView.extend(
753
763
 
754
764
  /**
755
765
  @private
756
-
757
766
  Pressing the Up or Down arrow key should display the menu pane
758
767
  */
759
768
  interpretKeyEvents: function(event) {
@@ -768,11 +777,6 @@ SC.SelectView = SC.ButtonView.extend(
768
777
  return arguments.callee.base.apply(this,arguments);
769
778
  },
770
779
 
771
- /** Function overridden - tied to the isEnabled state */
772
- acceptsFirstResponder: function() {
773
- return this.get('isEnabled');
774
- }.property('isEnabled'),
775
-
776
780
  /** @private
777
781
  Override the button isSelectedDidChange function in order to not perform any action
778
782
  on selecting the select_button
@@ -784,26 +788,118 @@ SC.SelectView = SC.ButtonView.extend(
784
788
  }) ;
785
789
 
786
790
  /**
787
- Default metrics for the different control sizes.
791
+ @static
792
+ @type Number
793
+ @default 0
788
794
  */
789
795
  SC.SelectView.TINY_OFFSET_X = 0;
796
+
797
+ /**
798
+ @static
799
+ @type Number
800
+ @default 0
801
+ */
790
802
  SC.SelectView.TINY_OFFSET_Y = 0;
803
+
804
+ /**
805
+ @static
806
+ @type Number
807
+ @default 0
808
+ */
791
809
  SC.SelectView.TINY_POPUP_MENU_WIDTH_OFFSET = 0;
792
810
 
811
+
812
+ /**
813
+ @static
814
+ @type Number
815
+ @default -18
816
+ */
793
817
  SC.SelectView.SMALL_OFFSET_X = -18;
818
+
819
+ /**
820
+ @static
821
+ @type Number
822
+ @default 3
823
+ */
794
824
  SC.SelectView.SMALL_OFFSET_Y = 3;
825
+
826
+ /**
827
+ @static
828
+ @type Number
829
+ @default 7
830
+ */
795
831
  SC.SelectView.SMALL_POPUP_MENU_WIDTH_OFFSET = 7;
796
832
 
833
+
834
+ /**
835
+ @static
836
+ @type Number
837
+ @default -17
838
+ */
797
839
  SC.SelectView.REGULAR_OFFSET_X = -17;
840
+
841
+ /**
842
+ @static
843
+ @type Number
844
+ @default 3
845
+ */
798
846
  SC.SelectView.REGULAR_OFFSET_Y = 3;
847
+
848
+ /**
849
+ @static
850
+ @type Number
851
+ @default 4
852
+ */
799
853
  SC.SelectView.REGULAR_POPUP_MENU_WIDTH_OFFSET = 4;
800
854
 
855
+
856
+ /**
857
+ @static
858
+ @type Number
859
+ @default -17
860
+ */
801
861
  SC.SelectView.LARGE_OFFSET_X = -17;
862
+
863
+ /**
864
+ @static
865
+ @type Number
866
+ @default 6
867
+ */
802
868
  SC.SelectView.LARGE_OFFSET_Y = 6;
869
+
870
+ /**
871
+ @static
872
+ @type Number
873
+ @default 3
874
+ */
803
875
  SC.SelectView.LARGE_POPUP_MENU_WIDTH_OFFSET = 3;
804
876
 
877
+
878
+ /**
879
+ @static
880
+ @type Number
881
+ @default 0
882
+ */
805
883
  SC.SelectView.HUGE_OFFSET_X = 0;
884
+
885
+ /**
886
+ @static
887
+ @type Number
888
+ @default 0
889
+ */
806
890
  SC.SelectView.HUGE_OFFSET_Y = 0;
891
+
892
+ /**
893
+ @static
894
+ @type Number
895
+ @default 0
896
+ */
807
897
  SC.SelectView.HUGE_POPUP_MENU_WIDTH_OFFSET = 0;
808
898
 
899
+
900
+ /**
901
+ @static
902
+ @type Number
903
+ @default -2
904
+ */
809
905
  SC.SelectView.MENU_WIDTH_OFFSET = -2;