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
@@ -7,51 +7,95 @@
|
|
7
7
|
|
8
8
|
sc_require('views/scroller');
|
9
9
|
|
10
|
+
/**
|
11
|
+
@static
|
12
|
+
@type Number
|
13
|
+
@default 0.95
|
14
|
+
*/
|
10
15
|
SC.NORMAL_SCROLL_DECELERATION = 0.95;
|
16
|
+
|
17
|
+
/**
|
18
|
+
@static
|
19
|
+
@type Number
|
20
|
+
@default 0.85
|
21
|
+
*/
|
11
22
|
SC.FAST_SCROLL_DECELERATION = 0.85;
|
12
23
|
|
13
24
|
/** @class
|
14
|
-
|
15
25
|
Implements a complete scroll view. This class uses a manual implementation
|
16
26
|
of scrollers in order to properly support clipping frames.
|
17
27
|
|
18
28
|
Important Events:
|
19
29
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
30
|
+
- contentView frame size changes (to autoshow/hide scrollbar - adjust scrollbar size)
|
31
|
+
- horizontalScrollOffset change
|
32
|
+
- verticalScrollOffsetChanges
|
33
|
+
- scroll wheel events
|
24
34
|
|
25
35
|
@extends SC.View
|
26
36
|
@since SproutCore 1.0
|
27
37
|
*/
|
28
38
|
SC.ScrollView = SC.View.extend({
|
29
|
-
|
39
|
+
/** @scope SC.ScrollView.prototype */
|
40
|
+
|
41
|
+
/**
|
42
|
+
@type Array
|
43
|
+
@default ['sc-scroll-view']
|
44
|
+
@see SC.View#classNames
|
45
|
+
*/
|
30
46
|
classNames: ['sc-scroll-view'],
|
31
47
|
|
32
48
|
// ..........................................................
|
33
49
|
// PROPERTIES
|
34
50
|
//
|
35
51
|
|
52
|
+
/**
|
53
|
+
Walk like a duck
|
54
|
+
|
55
|
+
@type Boolean
|
56
|
+
@default YES
|
57
|
+
@readOnly
|
58
|
+
*/
|
36
59
|
isScrollable: YES,
|
37
60
|
|
38
61
|
/**
|
39
62
|
The content view you want the scroll view to manage. This will be assigned to the contentView of the clipView also.
|
63
|
+
|
64
|
+
@type SC.View
|
65
|
+
@default null
|
40
66
|
*/
|
41
67
|
contentView: null,
|
42
68
|
|
43
69
|
/**
|
44
|
-
The horizontal alignment for non-filling content inside of the ScrollView.
|
70
|
+
The horizontal alignment for non-filling content inside of the ScrollView. Possible values:
|
71
|
+
|
72
|
+
- SC.ALIGN_LEFT
|
73
|
+
- SC.ALIGN_RIGHT
|
74
|
+
- SC.ALIGN_CENTER
|
75
|
+
|
76
|
+
@type String
|
77
|
+
@default SC.ALIGN_LEFT
|
45
78
|
*/
|
46
79
|
horizontalAlign: SC.ALIGN_LEFT,
|
47
80
|
|
48
81
|
/**
|
49
|
-
The vertical alignment for non-filling content inside of the ScrollView.
|
82
|
+
The vertical alignment for non-filling content inside of the ScrollView. Possible values:
|
83
|
+
|
84
|
+
- SC.ALIGN_TOP
|
85
|
+
- SC.ALIGN_BOTTOM
|
86
|
+
- SC.ALIGN_MIDDLE
|
87
|
+
|
88
|
+
@type String
|
89
|
+
@default SC.ALIGN_TOP
|
50
90
|
*/
|
51
91
|
verticalAlign: SC.ALIGN_TOP,
|
52
92
|
|
53
93
|
/**
|
54
94
|
The current horizontal scroll offset. Changing this value will update both the contentView and the horizontal scroller, if there is one.
|
95
|
+
|
96
|
+
@field
|
97
|
+
@type Number
|
98
|
+
@default 0
|
55
99
|
*/
|
56
100
|
horizontalScrollOffset: function(key, value) {
|
57
101
|
if (value !== undefined) {
|
@@ -65,6 +109,10 @@ SC.ScrollView = SC.View.extend({
|
|
65
109
|
|
66
110
|
/**
|
67
111
|
The current vertical scroll offset. Changing this value will update both the contentView and the vertical scroller, if there is one.
|
112
|
+
|
113
|
+
@field
|
114
|
+
@type Number
|
115
|
+
@default 0
|
68
116
|
*/
|
69
117
|
verticalScrollOffset: function(key, value) {
|
70
118
|
if (value !== undefined) {
|
@@ -76,8 +124,7 @@ SC.ScrollView = SC.View.extend({
|
|
76
124
|
return this._scroll_verticalScrollOffset||0;
|
77
125
|
}.property().cacheable(),
|
78
126
|
|
79
|
-
/**
|
80
|
-
@private
|
127
|
+
/** @private
|
81
128
|
Calculates the maximum offset given content and container sizes, and the
|
82
129
|
alignment.
|
83
130
|
*/
|
@@ -101,8 +148,7 @@ SC.ScrollView = SC.View.extend({
|
|
101
148
|
}
|
102
149
|
},
|
103
150
|
|
104
|
-
/**
|
105
|
-
@private
|
151
|
+
/** @private
|
106
152
|
Calculates the minimum offset given content and container sizes, and the
|
107
153
|
alignment.
|
108
154
|
*/
|
@@ -130,7 +176,9 @@ SC.ScrollView = SC.View.extend({
|
|
130
176
|
size and the size of the scroll view. If horizontal scrolling is
|
131
177
|
disabled, this will always return 0.
|
132
178
|
|
133
|
-
@
|
179
|
+
@field
|
180
|
+
@type Number
|
181
|
+
@default 0
|
134
182
|
*/
|
135
183
|
maximumHorizontalScrollOffset: function() {
|
136
184
|
var view = this.get('contentView') ;
|
@@ -157,7 +205,9 @@ SC.ScrollView = SC.View.extend({
|
|
157
205
|
size and the size of the scroll view. If vertical scrolling is disabled,
|
158
206
|
this will always return 0 (or whatever alignment dictates).
|
159
207
|
|
160
|
-
@
|
208
|
+
@field
|
209
|
+
@type Number
|
210
|
+
@default 0
|
161
211
|
*/
|
162
212
|
maximumVerticalScrollOffset: function() {
|
163
213
|
var view = this.get('contentView'),
|
@@ -185,7 +235,9 @@ SC.ScrollView = SC.View.extend({
|
|
185
235
|
size and the size of the scroll view. If horizontal scrolling is
|
186
236
|
disabled, this will always return 0 (or whatever alignment dictates).
|
187
237
|
|
188
|
-
@
|
238
|
+
@field
|
239
|
+
@type Number
|
240
|
+
@default 0
|
189
241
|
*/
|
190
242
|
minimumHorizontalScrollOffset: function() {
|
191
243
|
var view = this.get('contentView') ;
|
@@ -211,7 +263,9 @@ SC.ScrollView = SC.View.extend({
|
|
211
263
|
size and the size of the scroll view. If vertical scrolling is disabled,
|
212
264
|
this will always return 0 (or whatever alignment dictates).
|
213
265
|
|
214
|
-
@
|
266
|
+
@field
|
267
|
+
@type Number
|
268
|
+
@default 0
|
215
269
|
*/
|
216
270
|
minimumVerticalScrollOffset: function() {
|
217
271
|
var view = this.get('contentView') ;
|
@@ -234,12 +288,13 @@ SC.ScrollView = SC.View.extend({
|
|
234
288
|
}.property(),
|
235
289
|
|
236
290
|
|
237
|
-
|
238
291
|
/**
|
239
292
|
Amount to scroll one vertical line.
|
240
293
|
|
241
|
-
Used by the default implementation of scrollDownLine() and scrollUpLine().
|
242
|
-
|
294
|
+
Used by the default implementation of scrollDownLine() and scrollUpLine().
|
295
|
+
|
296
|
+
@type Number
|
297
|
+
@default 20
|
243
298
|
*/
|
244
299
|
verticalLineScroll: 20,
|
245
300
|
|
@@ -247,30 +302,43 @@ SC.ScrollView = SC.View.extend({
|
|
247
302
|
Amount to scroll one horizontal line.
|
248
303
|
|
249
304
|
Used by the default implementation of scrollLeftLine() and
|
250
|
-
scrollRightLine().
|
305
|
+
scrollRightLine().
|
306
|
+
|
307
|
+
@type Number
|
308
|
+
@default 20
|
251
309
|
*/
|
252
310
|
horizontalLineScroll: 20,
|
253
311
|
|
254
312
|
/**
|
255
313
|
Amount to scroll one vertical page.
|
256
314
|
|
257
|
-
Used by the default implementation of scrollUpPage() and scrollDownPage().
|
258
|
-
|
315
|
+
Used by the default implementation of scrollUpPage() and scrollDownPage().
|
316
|
+
|
317
|
+
@field
|
318
|
+
@type Number
|
319
|
+
@default value of frame.height
|
320
|
+
@observes frame
|
259
321
|
*/
|
260
322
|
verticalPageScroll: function() {
|
261
|
-
return this.get('frame').height
|
323
|
+
return this.get('frame').height;
|
262
324
|
}.property('frame'),
|
263
325
|
|
264
326
|
/**
|
265
327
|
Amount to scroll one horizontal page.
|
266
328
|
|
267
329
|
Used by the default implementation of scrollLeftPage() and
|
268
|
-
scrollRightPage().
|
330
|
+
scrollRightPage().
|
331
|
+
|
332
|
+
@field
|
333
|
+
@type Number
|
334
|
+
@default value of frame.width
|
335
|
+
@observes frame
|
269
336
|
*/
|
270
337
|
horizontalPageScroll: function() {
|
271
|
-
return this.get('frame').width
|
338
|
+
return this.get('frame').width;
|
272
339
|
}.property('frame'),
|
273
|
-
|
340
|
+
|
341
|
+
|
274
342
|
// ..........................................................
|
275
343
|
// SCROLLERS
|
276
344
|
//
|
@@ -279,7 +347,8 @@ SC.ScrollView = SC.View.extend({
|
|
279
347
|
YES if the view should maintain a horizontal scroller. This property
|
280
348
|
must be set when the view is created.
|
281
349
|
|
282
|
-
@
|
350
|
+
@type Boolean
|
351
|
+
@default YES
|
283
352
|
*/
|
284
353
|
hasHorizontalScroller: YES,
|
285
354
|
|
@@ -288,7 +357,8 @@ SC.ScrollView = SC.View.extend({
|
|
288
357
|
instance when the ScrollView is created unless hasHorizontalScroller is
|
289
358
|
NO.
|
290
359
|
|
291
|
-
@
|
360
|
+
@type SC.View
|
361
|
+
@default SC.ScrollerView
|
292
362
|
*/
|
293
363
|
horizontalScrollerView: SC.ScrollerView,
|
294
364
|
|
@@ -296,6 +366,9 @@ SC.ScrollView = SC.View.extend({
|
|
296
366
|
The horizontal scroller view for touch. This will be replaced with a view
|
297
367
|
instance when touch is enabled when the ScrollView is created unless
|
298
368
|
hasHorizontalScroller is NO.
|
369
|
+
|
370
|
+
@type SC.View
|
371
|
+
@default SC.TouchScrollerView
|
299
372
|
*/
|
300
373
|
horizontalTouchScrollerView: SC.TouchScrollerView,
|
301
374
|
|
@@ -306,7 +379,8 @@ SC.ScrollView = SC.View.extend({
|
|
306
379
|
hasHorizontalScroller to NO to avoid creating a scroller view in the
|
307
380
|
first place.
|
308
381
|
|
309
|
-
@
|
382
|
+
@type Boolean
|
383
|
+
@default YES
|
310
384
|
*/
|
311
385
|
isHorizontalScrollerVisible: YES,
|
312
386
|
|
@@ -314,7 +388,9 @@ SC.ScrollView = SC.View.extend({
|
|
314
388
|
Returns YES if the view both has a horizontal scroller, the scroller is
|
315
389
|
visible.
|
316
390
|
|
317
|
-
@
|
391
|
+
@field
|
392
|
+
@type Boolean
|
393
|
+
@default YES
|
318
394
|
*/
|
319
395
|
canScrollHorizontal: function() {
|
320
396
|
return !!(this.get('hasHorizontalScroller') &&
|
@@ -325,7 +401,10 @@ SC.ScrollView = SC.View.extend({
|
|
325
401
|
/**
|
326
402
|
If YES, the horizontal scroller will autohide if the contentView is
|
327
403
|
smaller than the visible area. You must set hasHorizontalScroller to YES
|
328
|
-
for this property to have any effect.
|
404
|
+
for this property to have any effect.
|
405
|
+
|
406
|
+
@type Boolean
|
407
|
+
@default YES
|
329
408
|
*/
|
330
409
|
autohidesHorizontalScroller: YES,
|
331
410
|
|
@@ -333,7 +412,8 @@ SC.ScrollView = SC.View.extend({
|
|
333
412
|
YES if the view shuld maintain a vertical scroller. This property must
|
334
413
|
be set when the view is created.
|
335
414
|
|
336
|
-
@
|
415
|
+
@type Boolean
|
416
|
+
@default YES
|
337
417
|
*/
|
338
418
|
hasVerticalScroller: YES,
|
339
419
|
|
@@ -341,13 +421,17 @@ SC.ScrollView = SC.View.extend({
|
|
341
421
|
The vertical scroller view class. This will be replaced with a view
|
342
422
|
instance when the ScrollView is created unless hasVerticalScroller is NO.
|
343
423
|
|
344
|
-
@
|
424
|
+
@type SC.View
|
425
|
+
@default SC.ScrollerView
|
345
426
|
*/
|
346
427
|
verticalScrollerView: SC.ScrollerView,
|
347
428
|
|
348
429
|
/**
|
349
430
|
The vertical touch scroller view class. This will be replaced with a view
|
350
431
|
instance when the ScrollView is created.
|
432
|
+
|
433
|
+
@type SC.View
|
434
|
+
@default SC.TouchScrollerView
|
351
435
|
*/
|
352
436
|
verticalTouchScrollerView: SC.TouchScrollerView,
|
353
437
|
|
@@ -358,7 +442,8 @@ SC.ScrollView = SC.View.extend({
|
|
358
442
|
hasVerticalScroller to NO to avoid creating a scroller view in the first
|
359
443
|
place.
|
360
444
|
|
361
|
-
@
|
445
|
+
@type Boolean
|
446
|
+
@default YES
|
362
447
|
*/
|
363
448
|
isVerticalScrollerVisible: YES,
|
364
449
|
|
@@ -366,7 +451,9 @@ SC.ScrollView = SC.View.extend({
|
|
366
451
|
Returns YES if the view both has a horizontal scroller, the scroller is
|
367
452
|
visible.
|
368
453
|
|
369
|
-
@
|
454
|
+
@field
|
455
|
+
@type Boolean
|
456
|
+
@default YES
|
370
457
|
*/
|
371
458
|
canScrollVertical: function() {
|
372
459
|
return !!(this.get('hasVerticalScroller') &&
|
@@ -377,7 +464,10 @@ SC.ScrollView = SC.View.extend({
|
|
377
464
|
/**
|
378
465
|
If YES, the vertical scroller will autohide if the contentView is
|
379
466
|
smaller than the visible area. You must set hasVerticalScroller to YES
|
380
|
-
for this property to have any effect.
|
467
|
+
for this property to have any effect.
|
468
|
+
|
469
|
+
@type Boolean
|
470
|
+
@default YES
|
381
471
|
*/
|
382
472
|
autohidesVerticalScroller: YES,
|
383
473
|
|
@@ -385,7 +475,8 @@ SC.ScrollView = SC.View.extend({
|
|
385
475
|
Use this property to set the 'bottom' offset of your vertical scroller,
|
386
476
|
to make room for a thumb view or other accessory view. Default is 0.
|
387
477
|
|
388
|
-
@
|
478
|
+
@type Number
|
479
|
+
@default 0
|
389
480
|
*/
|
390
481
|
verticalScrollerBottom: 0,
|
391
482
|
|
@@ -395,8 +486,10 @@ SC.ScrollView = SC.View.extend({
|
|
395
486
|
This ensures that the container frame will not resize to accomodate the
|
396
487
|
vertical scroller, hence overlaying the scroller on top of
|
397
488
|
the container.
|
398
|
-
|
399
|
-
@
|
489
|
+
|
490
|
+
@field
|
491
|
+
@type Boolean
|
492
|
+
@default NO
|
400
493
|
*/
|
401
494
|
verticalOverlay: function() {
|
402
495
|
if (SC.platform.touch) return YES;
|
@@ -410,7 +503,9 @@ SC.ScrollView = SC.View.extend({
|
|
410
503
|
horizontal scroller, hence overlaying the scroller on top of
|
411
504
|
the container
|
412
505
|
|
413
|
-
@
|
506
|
+
@field
|
507
|
+
@type Boolean
|
508
|
+
@default NO
|
414
509
|
*/
|
415
510
|
horizontalOverlay: function() {
|
416
511
|
if (SC.platform.touch) return YES;
|
@@ -428,6 +523,9 @@ SC.ScrollView = SC.View.extend({
|
|
428
523
|
“float on top” of the content view.
|
429
524
|
|
430
525
|
Example: { top: -1, bottom: -1, right: 0 }
|
526
|
+
|
527
|
+
@type Hash
|
528
|
+
@default null
|
431
529
|
*/
|
432
530
|
verticalScrollerLayout: null,
|
433
531
|
|
@@ -441,6 +539,9 @@ SC.ScrollView = SC.View.extend({
|
|
441
539
|
“float on top” of the content view.
|
442
540
|
|
443
541
|
Example: { left: 0, bottom: 0, right: 0 }
|
542
|
+
|
543
|
+
@type Hash
|
544
|
+
@default null
|
444
545
|
*/
|
445
546
|
horizontalScrollerLayout: null,
|
446
547
|
|
@@ -452,11 +553,11 @@ SC.ScrollView = SC.View.extend({
|
|
452
553
|
The container view that will contain your main content view. You can
|
453
554
|
replace this property with your own custom subclass if you prefer.
|
454
555
|
|
455
|
-
@type
|
556
|
+
@type SC.ContainerView
|
557
|
+
@default SC.ConainerView
|
456
558
|
*/
|
457
|
-
containerView: SC.ContainerView.extend({
|
458
|
-
|
459
|
-
}),
|
559
|
+
containerView: SC.ContainerView.extend({}),
|
560
|
+
|
460
561
|
|
461
562
|
// ..........................................................
|
462
563
|
// METHODS
|
@@ -475,8 +576,8 @@ SC.ScrollView = SC.View.extend({
|
|
475
576
|
direction. You can also optionally pass a Hash for the first parameter
|
476
577
|
with x and y coordinates.
|
477
578
|
|
478
|
-
@param
|
479
|
-
@param
|
579
|
+
@param {Number} x the x scroll location
|
580
|
+
@param {Number} y the y scroll location
|
480
581
|
@returns {SC.ScrollView} receiver
|
481
582
|
*/
|
482
583
|
scrollTo: function(x,y) {
|
@@ -505,8 +606,8 @@ SC.ScrollView = SC.View.extend({
|
|
505
606
|
direction. You can also optionally pass a Hash for the first parameter
|
506
607
|
with x and y coordinates.
|
507
608
|
|
508
|
-
@param
|
509
|
-
@param
|
609
|
+
@param {Number} x change in the x direction (or hash)
|
610
|
+
@param {Number} y change in the y direction
|
510
611
|
@returns {SC.ScrollView} receiver
|
511
612
|
*/
|
512
613
|
scrollBy: function(x , y) {
|
@@ -551,7 +652,7 @@ SC.ScrollView = SC.View.extend({
|
|
551
652
|
|
552
653
|
/**
|
553
654
|
Scroll to the supplied rectangle.
|
554
|
-
@param {
|
655
|
+
@param {Rect} rect Rectangle to scroll to.
|
555
656
|
@returns {Boolean} YES if scroll position was changed.
|
556
657
|
*/
|
557
658
|
scrollToRect: function(rect) {
|
@@ -583,7 +684,7 @@ SC.ScrollView = SC.View.extend({
|
|
583
684
|
Scrolls the receiver down one or more lines if allowed. If number of
|
584
685
|
lines is not specified, scrolls one line.
|
585
686
|
|
586
|
-
@param
|
687
|
+
@param {Number} lines number of lines
|
587
688
|
@returns {SC.ScrollView} receiver
|
588
689
|
*/
|
589
690
|
scrollDownLine: function(lines) {
|
@@ -595,7 +696,7 @@ SC.ScrollView = SC.View.extend({
|
|
595
696
|
Scrolls the receiver up one or more lines if allowed. If number of
|
596
697
|
lines is not specified, scrolls one line.
|
597
698
|
|
598
|
-
@param
|
699
|
+
@param {Number} lines number of lines
|
599
700
|
@returns {SC.ScrollView} receiver
|
600
701
|
*/
|
601
702
|
scrollUpLine: function(lines) {
|
@@ -607,7 +708,7 @@ SC.ScrollView = SC.View.extend({
|
|
607
708
|
Scrolls the receiver right one or more lines if allowed. If number of
|
608
709
|
lines is not specified, scrolls one line.
|
609
710
|
|
610
|
-
@param
|
711
|
+
@param {Number} lines number of lines
|
611
712
|
@returns {SC.ScrollView} receiver
|
612
713
|
*/
|
613
714
|
scrollRightLine: function(lines) {
|
@@ -619,7 +720,7 @@ SC.ScrollView = SC.View.extend({
|
|
619
720
|
Scrolls the receiver left one or more lines if allowed. If number of
|
620
721
|
lines is not specified, scrolls one line.
|
621
722
|
|
622
|
-
@param
|
723
|
+
@param {Number} lines number of lines
|
623
724
|
@returns {SC.ScrollView} receiver
|
624
725
|
*/
|
625
726
|
scrollLeftLine: function(lines) {
|
@@ -633,7 +734,7 @@ SC.ScrollView = SC.View.extend({
|
|
633
734
|
the verticalPageScroll value. By default this is the size of the current
|
634
735
|
scrollable area.
|
635
736
|
|
636
|
-
@param
|
737
|
+
@param {Number} pages number of lines
|
637
738
|
@returns {SC.ScrollView} receiver
|
638
739
|
*/
|
639
740
|
scrollDownPage: function(pages) {
|
@@ -647,7 +748,7 @@ SC.ScrollView = SC.View.extend({
|
|
647
748
|
the verticalPageScroll value. By default this is the size of the current
|
648
749
|
scrollable area.
|
649
750
|
|
650
|
-
@param
|
751
|
+
@param {Number} pages number of lines
|
651
752
|
@returns {SC.ScrollView} receiver
|
652
753
|
*/
|
653
754
|
scrollUpPage: function(pages) {
|
@@ -661,7 +762,7 @@ SC.ScrollView = SC.View.extend({
|
|
661
762
|
the verticalPageScroll value. By default this is the size of the current
|
662
763
|
scrollable area.
|
663
764
|
|
664
|
-
@param
|
765
|
+
@param {Number} pages number of lines
|
665
766
|
@returns {SC.ScrollView} receiver
|
666
767
|
*/
|
667
768
|
scrollRightPage: function(pages) {
|
@@ -675,7 +776,7 @@ SC.ScrollView = SC.View.extend({
|
|
675
776
|
the verticalPageScroll value. By default this is the size of the current
|
676
777
|
scrollable area.
|
677
778
|
|
678
|
-
@param
|
779
|
+
@param {Number} pages number of lines
|
679
780
|
@returns {SC.ScrollView} receiver
|
680
781
|
*/
|
681
782
|
scrollLeftPage: function(pages) {
|
@@ -683,7 +784,7 @@ SC.ScrollView = SC.View.extend({
|
|
683
784
|
return this.scrollBy(0-(this.get('horizontalPageScroll')*pages), null) ;
|
684
785
|
},
|
685
786
|
|
686
|
-
/**
|
787
|
+
/** @private
|
687
788
|
Adjusts the layout for the various internal views. This method is called
|
688
789
|
once when the scroll view is first configured and then anytime a scroller
|
689
790
|
is shown or hidden. You can call this method yourself as well to retile.
|
@@ -755,11 +856,13 @@ SC.ScrollView = SC.View.extend({
|
|
755
856
|
// SCROLL WHEEL SUPPORT
|
756
857
|
//
|
757
858
|
|
758
|
-
/** @private */
|
759
|
-
|
859
|
+
/** @private */
|
860
|
+
_scroll_wheelDeltaX: 0,
|
760
861
|
|
761
|
-
|
762
|
-
|
862
|
+
/** @private */
|
863
|
+
_scroll_wheelDeltaY: 0,
|
864
|
+
|
865
|
+
/** @private */
|
763
866
|
mouseWheel: function(evt) {
|
764
867
|
var deltaAdjust = (SC.browser.webkit && SC.browser.version > 533.0) ? 120 : 1;
|
765
868
|
|
@@ -792,13 +895,22 @@ SC.ScrollView = SC.View.extend({
|
|
792
895
|
|
793
896
|
/**
|
794
897
|
Determines whether scaling is allowed.
|
898
|
+
|
899
|
+
@type Boolean
|
900
|
+
@default NO
|
795
901
|
*/
|
796
902
|
canScale: NO,
|
797
903
|
|
798
|
-
/**
|
904
|
+
/** @private
|
799
905
|
The current scale.
|
800
906
|
*/
|
801
907
|
_scale: 1.0,
|
908
|
+
|
909
|
+
/**
|
910
|
+
@field
|
911
|
+
@type Number
|
912
|
+
@default 1.0
|
913
|
+
*/
|
802
914
|
scale: function(key, value) {
|
803
915
|
if (value !== undefined) {
|
804
916
|
this._scale = Math.min(Math.max(this.get("minimumScale"), value), this.get("maximumScale"));
|
@@ -808,21 +920,32 @@ SC.ScrollView = SC.View.extend({
|
|
808
920
|
|
809
921
|
/**
|
810
922
|
The minimum scale.
|
923
|
+
|
924
|
+
@type Number
|
925
|
+
@default 0.25
|
811
926
|
*/
|
812
927
|
minimumScale: 0.25,
|
813
928
|
|
814
929
|
/**
|
815
930
|
The maximum scale.
|
931
|
+
|
932
|
+
@type Number
|
933
|
+
@default 2.0
|
816
934
|
*/
|
817
935
|
maximumScale: 2.0,
|
818
936
|
|
819
937
|
/**
|
820
938
|
Whether to automatically determine the scale range based on the size of the content.
|
939
|
+
|
940
|
+
@type Boolean
|
941
|
+
@default NO
|
821
942
|
*/
|
822
943
|
autoScaleRange: NO,
|
823
944
|
|
945
|
+
/** @private */
|
824
946
|
_scale_css: "",
|
825
947
|
|
948
|
+
/** @private */
|
826
949
|
updateScale: function(scale) {
|
827
950
|
var contentView = this.get("contentView");
|
828
951
|
if (!contentView) return;
|
@@ -835,35 +958,53 @@ SC.ScrollView = SC.View.extend({
|
|
835
958
|
}
|
836
959
|
},
|
837
960
|
|
838
|
-
|
839
|
-
|
961
|
+
|
962
|
+
// ..........................................................
|
963
|
+
// Touch Support
|
964
|
+
//
|
965
|
+
|
966
|
+
/**
|
967
|
+
@type Boolean
|
968
|
+
@default YES
|
969
|
+
@readOnly
|
840
970
|
*/
|
841
971
|
acceptsMultitouch: YES,
|
842
972
|
|
843
973
|
/**
|
844
974
|
The scroll deceleration rate.
|
975
|
+
|
976
|
+
@type Number
|
977
|
+
@default SC.NORMAL_SCROLL_DECELERATION
|
845
978
|
*/
|
846
979
|
decelerationRate: SC.NORMAL_SCROLL_DECELERATION,
|
847
980
|
|
848
981
|
/**
|
849
982
|
If YES, bouncing will always be enabled in the horizontal direction, even if the content
|
850
|
-
is smaller or the same size as the view.
|
983
|
+
is smaller or the same size as the view.
|
984
|
+
|
985
|
+
@type Boolean
|
986
|
+
@default NO
|
851
987
|
*/
|
852
988
|
alwaysBounceHorizontal: NO,
|
853
989
|
|
854
990
|
/**
|
855
991
|
If NO, bouncing will not be enabled in the vertical direction when the content is smaller
|
856
|
-
or the same size as the scroll view.
|
992
|
+
or the same size as the scroll view.
|
993
|
+
|
994
|
+
@type Boolean
|
995
|
+
@default YES
|
857
996
|
*/
|
858
997
|
alwaysBounceVertical: YES,
|
859
998
|
|
860
999
|
/**
|
861
1000
|
Whether to delay touches from passing through to the content.
|
1001
|
+
|
1002
|
+
@type Boolean
|
1003
|
+
@default YES
|
862
1004
|
*/
|
863
1005
|
delaysContentTouches: YES,
|
864
1006
|
|
865
|
-
/**
|
866
|
-
@private
|
1007
|
+
/** @private
|
867
1008
|
If the view supports it, this
|
868
1009
|
*/
|
869
1010
|
_touchScrollDidChange: function() {
|
@@ -884,6 +1025,7 @@ SC.ScrollView = SC.View.extend({
|
|
884
1025
|
}
|
885
1026
|
},
|
886
1027
|
|
1028
|
+
/** @private */
|
887
1029
|
_touchScrollDidStart: function() {
|
888
1030
|
if (this.get("contentView").touchScrollDidStart) {
|
889
1031
|
this.get("contentView").touchScrollDidStart(this._scroll_horizontalScrollOffset, this._scroll_verticalScrollOffset);
|
@@ -898,6 +1040,7 @@ SC.ScrollView = SC.View.extend({
|
|
898
1040
|
}
|
899
1041
|
},
|
900
1042
|
|
1043
|
+
/** @private */
|
901
1044
|
_touchScrollDidEnd: function() {
|
902
1045
|
if (this.get("contentView").touchScrollDidEnd) {
|
903
1046
|
this.get("contentView").touchScrollDidEnd(this._scroll_horizontalScrollOffset, this._scroll_verticalScrollOffset);
|
@@ -913,6 +1056,7 @@ SC.ScrollView = SC.View.extend({
|
|
913
1056
|
}
|
914
1057
|
},
|
915
1058
|
|
1059
|
+
/** @private */
|
916
1060
|
_applyCSSTransforms: function(layer) {
|
917
1061
|
var transform = "";
|
918
1062
|
this.updateScale(this._scale);
|
@@ -924,11 +1068,15 @@ SC.ScrollView = SC.View.extend({
|
|
924
1068
|
}
|
925
1069
|
},
|
926
1070
|
|
1071
|
+
/** @private */
|
927
1072
|
captureTouch: function(touch) {
|
928
1073
|
return YES;
|
929
1074
|
},
|
930
1075
|
|
1076
|
+
/** @private */
|
931
1077
|
touchGeneration: 0,
|
1078
|
+
|
1079
|
+
/** @private */
|
932
1080
|
touchStart: function(touch) {
|
933
1081
|
var generation = ++this.touchGeneration;
|
934
1082
|
if (!this.tracking && this.get("delaysContentTouches")) {
|
@@ -942,6 +1090,7 @@ SC.ScrollView = SC.View.extend({
|
|
942
1090
|
return YES;
|
943
1091
|
},
|
944
1092
|
|
1093
|
+
/** @private */
|
945
1094
|
beginTouchesInContent: function(gen) {
|
946
1095
|
if (gen !== this.touchGeneration) return;
|
947
1096
|
|
@@ -963,7 +1112,7 @@ SC.ScrollView = SC.View.extend({
|
|
963
1112
|
}
|
964
1113
|
},
|
965
1114
|
|
966
|
-
/**
|
1115
|
+
/** @private
|
967
1116
|
Initializes the start state of the gesture.
|
968
1117
|
|
969
1118
|
We keep information about the initial location of the touch so we can
|
@@ -1078,6 +1227,7 @@ SC.ScrollView = SC.View.extend({
|
|
1078
1227
|
}
|
1079
1228
|
},
|
1080
1229
|
|
1230
|
+
/** @private */
|
1081
1231
|
_adjustForEdgeResistance: function(offset, minOffset, maxOffset, resistanceCoefficient, asymptote) {
|
1082
1232
|
var distanceFromEdge;
|
1083
1233
|
|
@@ -1097,11 +1247,13 @@ SC.ScrollView = SC.View.extend({
|
|
1097
1247
|
return Math.min(Math.max(minOffset, offset), maxOffset) + distanceFromEdge;
|
1098
1248
|
},
|
1099
1249
|
|
1250
|
+
/** @private */
|
1100
1251
|
touchesDragged: function(evt, touches) {
|
1101
1252
|
var avg = evt.averagedTouchesForView(this);
|
1102
1253
|
this.updateTouchScroll(avg.x, avg.y, avg.d, evt.timeStamp);
|
1103
1254
|
},
|
1104
1255
|
|
1256
|
+
/** @private */
|
1105
1257
|
updateTouchScroll: function(touchX, touchY, distance, timeStamp) {
|
1106
1258
|
// get some vars
|
1107
1259
|
var touch = this.touch,
|
@@ -1232,6 +1384,7 @@ SC.ScrollView = SC.View.extend({
|
|
1232
1384
|
}
|
1233
1385
|
},
|
1234
1386
|
|
1387
|
+
/** @private */
|
1235
1388
|
touchEnd: function(touch) {
|
1236
1389
|
var touchStatus = this.touch,
|
1237
1390
|
avg = touch.averagedTouchesForView(this);
|
@@ -1278,6 +1431,7 @@ SC.ScrollView = SC.View.extend({
|
|
1278
1431
|
}
|
1279
1432
|
},
|
1280
1433
|
|
1434
|
+
/** @private */
|
1281
1435
|
touchCancelled: function(touch) {
|
1282
1436
|
var touchStatus = this.touch,
|
1283
1437
|
avg = touch.averagedTouchesForView(this);
|
@@ -1300,6 +1454,7 @@ SC.ScrollView = SC.View.extend({
|
|
1300
1454
|
}
|
1301
1455
|
},
|
1302
1456
|
|
1457
|
+
/** @private */
|
1303
1458
|
startDecelerationAnimation: function(evt) {
|
1304
1459
|
var touch = this.touch;
|
1305
1460
|
touch.decelerationVelocity = {
|
@@ -1310,8 +1465,7 @@ SC.ScrollView = SC.View.extend({
|
|
1310
1465
|
this.decelerateAnimation();
|
1311
1466
|
},
|
1312
1467
|
|
1313
|
-
/**
|
1314
|
-
@private
|
1468
|
+
/** @private
|
1315
1469
|
Does bounce calculations, adjusting velocity.
|
1316
1470
|
|
1317
1471
|
Bouncing is fun. Functions that handle it should have fun names,
|
@@ -1349,6 +1503,7 @@ SC.ScrollView = SC.View.extend({
|
|
1349
1503
|
return velocity;
|
1350
1504
|
},
|
1351
1505
|
|
1506
|
+
/** @private */
|
1352
1507
|
decelerateAnimation: function() {
|
1353
1508
|
// get a bunch of properties. They are named well, so not much explanation of what they are...
|
1354
1509
|
// However, note maxOffsetX/Y takes into account the scale;
|
@@ -1569,6 +1724,7 @@ SC.ScrollView = SC.View.extend({
|
|
1569
1724
|
this.tile() ; // set up initial tiling
|
1570
1725
|
},
|
1571
1726
|
|
1727
|
+
/** @private */
|
1572
1728
|
init: function() {
|
1573
1729
|
sc_super();
|
1574
1730
|
|
@@ -1587,7 +1743,9 @@ SC.ScrollView = SC.View.extend({
|
|
1587
1743
|
if (this.get('isVisibleInWindow')) this._scsv_registerAutoscroll() ;
|
1588
1744
|
},
|
1589
1745
|
|
1590
|
-
/** @private
|
1746
|
+
/** @private
|
1747
|
+
Registers/deregisters view with SC.Drag for autoscrolling
|
1748
|
+
*/
|
1591
1749
|
_scsv_registerAutoscroll: function() {
|
1592
1750
|
if (this.get('isVisibleInWindow')) SC.Drag.addScrollableView(this);
|
1593
1751
|
else SC.Drag.removeScrollableView(this);
|
@@ -1644,6 +1802,12 @@ SC.ScrollView = SC.View.extend({
|
|
1644
1802
|
return sc_super();
|
1645
1803
|
},
|
1646
1804
|
|
1805
|
+
/** @private */
|
1806
|
+
oldMaxHOffset: 0,
|
1807
|
+
|
1808
|
+
/** @private */
|
1809
|
+
oldMaxVOffset: 0,
|
1810
|
+
|
1647
1811
|
/** @private
|
1648
1812
|
Invoked whenever the contentView's frame changes. This will update the
|
1649
1813
|
scroller maxmimum and optionally update the scroller visibility if the
|
@@ -1652,10 +1816,6 @@ SC.ScrollView = SC.View.extend({
|
|
1652
1816
|
|
1653
1817
|
@param {Boolean} force (optional) Re-calculate everything even if the contentView’s frame didn’t change size
|
1654
1818
|
*/
|
1655
|
-
|
1656
|
-
oldMaxHOffset: 0,
|
1657
|
-
oldMaxVOffset: 0,
|
1658
|
-
|
1659
1819
|
contentViewFrameDidChange: function(force) {
|
1660
1820
|
var view = this.get('contentView'),
|
1661
1821
|
f = (view) ? view.get('frame') : null,
|
@@ -1802,6 +1962,7 @@ SC.ScrollView = SC.View.extend({
|
|
1802
1962
|
}
|
1803
1963
|
},
|
1804
1964
|
|
1965
|
+
/** @private */
|
1805
1966
|
forceDimensionsRecalculation: function (forceWidth, forceHeight, vOffSet, hOffSet) {
|
1806
1967
|
var oldScrollHOffset = hOffSet;
|
1807
1968
|
var oldScrollVOffset = vOffSet;
|
@@ -1817,7 +1978,10 @@ SC.ScrollView = SC.View.extend({
|
|
1817
1978
|
}
|
1818
1979
|
},
|
1819
1980
|
|
1981
|
+
/** @private */
|
1820
1982
|
_scroll_verticalScrollOffset: 0,
|
1983
|
+
|
1984
|
+
/** @private */
|
1821
1985
|
_scroll_horizontalScrollOffset: 0
|
1822
1986
|
|
1823
1987
|
});
|