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.
- data/CHANGELOG +4 -0
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/Buildfile +9 -4
- data/lib/frameworks/sproutcore/README.md +1 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Preview.pdf +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/QuickLook/Thumbnail.tiff +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/data.plist +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image10.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image11.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image13.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image15.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image16.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image17.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image18.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image19.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image22.tiff +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image23.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image24.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image25.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image30.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image31.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image8.png +0 -0
- data/lib/frameworks/sproutcore/design/{TestRunner_Design.gaffle → TestRunner_Design.graffle}/image9.png +0 -0
- data/lib/frameworks/sproutcore/frameworks/animation/core.js +23 -25
- data/lib/frameworks/sproutcore/frameworks/bootstrap/system/browser.js +160 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/controllers/array.js +73 -82
- data/lib/frameworks/sproutcore/frameworks/core_foundation/core.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/bind.js +110 -7
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/collection.js +10 -7
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/localization.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions → core_foundation/ext/handlebars}/view.js +4 -2
- data/lib/frameworks/sproutcore/frameworks/{handlebars/extensions.js → core_foundation/ext/handlebars.js} +0 -57
- data/lib/frameworks/sproutcore/frameworks/core_foundation/ext/object.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/mixins/template_helpers/text_field_support.js +11 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/main.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/application.js +14 -16
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/builder.js +29 -37
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/event.js +71 -19
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/locale.js +3 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +5 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/selection_set.js +1 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/sparse_array.js +4 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/timer.js +21 -27
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/utils.js +3 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/array/array_case.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/controllers/object/single_enumerable_case.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/system/sparse_array.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/template/handlebars.js +93 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/clippingFrame.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/convertLayouts.js +13 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layer.js +2 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/theme.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template.js +6 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/template_collection.js +87 -32
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +21 -25
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/cascade.js +15 -19
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +114 -167
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/models/child_attribute.js +4 -6
- data/lib/frameworks/sproutcore/frameworks/datastore/models/children_attribute.js +2 -4
- data/lib/frameworks/sproutcore/frameworks/datastore/models/fetched_attribute.js +7 -7
- data/lib/frameworks/sproutcore/frameworks/datastore/models/many_attribute.js +18 -20
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record.js +74 -72
- data/lib/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +36 -29
- data/lib/frameworks/sproutcore/frameworks/datastore/models/single_attribute.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/system/child_array.js +97 -78
- data/lib/frameworks/sproutcore/frameworks/datastore/system/many_array.js +117 -97
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +13 -13
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +111 -108
- data/lib/frameworks/sproutcore/frameworks/datastore/system/record_array.js +231 -198
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +146 -145
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/query/builders.js +21 -21
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/record_array/flush.js +49 -50
- data/lib/frameworks/sproutcore/frameworks/datetime/{system → frameworks/core/system}/datetime.js +122 -171
- data/lib/frameworks/sproutcore/frameworks/datetime/{tests → frameworks/core/tests}/system/datetime.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/{resources → frameworks/localized/resources}/strings.js +0 -0
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/localized/system/datetime.js +91 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/core.js +18 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/border.js +23 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_fast_path.js +56 -45
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_group.js +5 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_row_delegate.js +21 -19
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/collection_view_delegate.js +82 -77
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/navigation_builder.js +18 -12
- data/lib/frameworks/sproutcore/frameworks/desktop/mixins/scrollable.js +29 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/alert.js +148 -107
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/menu.js +31 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/modal.js +16 -13
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/palette.js +38 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +37 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +247 -144
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/select_button.js +155 -100
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +39 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_data_source.js +9 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drag_source.js +18 -22
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/drop_target.js +27 -17
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +77 -44
- data/lib/frameworks/sproutcore/frameworks/desktop/system/undo_manager.js +68 -33
- data/lib/frameworks/sproutcore/frameworks/desktop/views/button.js +168 -110
- data/lib/frameworks/sproutcore/frameworks/desktop/views/checkbox.js +37 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +187 -123
- data/lib/frameworks/sproutcore/frameworks/desktop/views/date_field.js +73 -49
- data/lib/frameworks/sproutcore/frameworks/desktop/views/disclosure.js +34 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/file.js +51 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/grid.js +38 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/image_button.js +15 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list.js +54 -34
- data/lib/frameworks/sproutcore/frameworks/desktop/views/list_item.js +113 -42
- data/lib/frameworks/sproutcore/frameworks/desktop/views/master_detail.js +84 -28
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +67 -51
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +122 -35
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation.js +40 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/navigation_bar.js +28 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +27 -31
- data/lib/frameworks/sproutcore/frameworks/desktop/views/progress.js +118 -68
- data/lib/frameworks/sproutcore/frameworks/desktop/views/radio.js +117 -61
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scene.js +23 -16
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll.js +241 -77
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroller.js +134 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segment.js +107 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +125 -48
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select.js +165 -69
- data/lib/frameworks/sproutcore/frameworks/desktop/views/select_field.js +73 -24
- data/lib/frameworks/sproutcore/frameworks/desktop/views/separator.js +19 -5
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list.js +16 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/views/source_list_group.js +14 -7
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +43 -37
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split_divider.js +8 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/stacked.js +14 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +16 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/views/tab.js +99 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/views/thumb.js +13 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/toolbar.js +58 -8
- data/lib/frameworks/sproutcore/frameworks/desktop/views/web.js +34 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/well.js +25 -9
- data/lib/frameworks/sproutcore/frameworks/desktop/views/workspace.js +70 -36
- data/lib/frameworks/sproutcore/frameworks/foundation/controllers/tree.js +10 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/debug/control_test_pane.js +28 -17
- data/lib/frameworks/sproutcore/frameworks/foundation/delegates/inline_text_field.js +41 -43
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/pinch.js +42 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/swipe.js +94 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +41 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_mixin.js +2 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +18 -9
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/collection_content.js +7 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_display.js +7 -8
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/content_value_support.js +34 -24
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/control.js +48 -18
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/inline_text_field.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/foundation/system/utils/misc.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tasks/preload_bundle.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/inline_text_field/beginEditing.js +0 -11
- data/lib/frameworks/sproutcore/frameworks/foundation/validators/date_time.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +8 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/README.md +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/package.json +21 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.css +215 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/qunit/qunit.js +1442 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/headless.html +24 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/index.html +18 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.html +17 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/logs.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/same.js +1421 -0
- data/lib/frameworks/sproutcore/frameworks/qunit/test/test.js +314 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/array.js +369 -60
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +2 -405
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +3 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/private/property_chain.js +50 -45
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +20 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +0 -9
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/core/guidFor.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/array.js +36 -14
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable.js +0 -34
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable/enumerable_observers.js +50 -61
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/observable.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/propertyChanges.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/observable/registerDependentKeys.js +45 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/mixins/propertyChanges.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/bindings.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/object/enhance.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/testing/core.js +3 -0
- data/lib/frameworks/sproutcore/frameworks/testing/system/plan.js +0 -1
- data/lib/frameworks/sproutcore/frameworks/testing/system/runner.js +0 -1
- data/lib/gen/html_app/templates/apps/@target_name@/@target_name@.js +1 -1
- data/vendor/chance/lib/chance/instance.rb +8 -6
- metadata +41 -31
- data/lib/frameworks/sproutcore/frameworks/testing/jquery.js +0 -3559
- 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
|
-
|
33
|
-
@
|
26
|
+
/**
|
27
|
+
@field
|
28
|
+
@type Boolean
|
29
|
+
@default YES
|
34
30
|
*/
|
35
|
-
|
31
|
+
acceptsFirstResponder: function() {
|
32
|
+
return this.get('isEnabled');
|
33
|
+
}.property('isEnabled'),
|
36
34
|
|
37
35
|
/**
|
38
|
-
|
36
|
+
An array of items that will be form the menu you want to show.
|
39
37
|
|
40
|
-
@
|
41
|
-
@default
|
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
|
-
@
|
51
|
-
@
|
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
|
-
@
|
62
|
-
@
|
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
|
-
@
|
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
|
-
|
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
|
-
@
|
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
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
|
204
|
-
|
205
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
@
|
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
|
-
|
286
|
-
|
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
|
-
|
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
|
-
|
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;
|