sproutcore 1.11.0.rc2 → 1.11.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +10 -0
- data/VERSION.yml +1 -1
- data/lib/frameworks/sproutcore/CHANGELOG.md +114 -1
- data/lib/frameworks/sproutcore/apps/showcase/views/views_item_view.js +1 -7
- data/lib/frameworks/sproutcore/apps/showcase/views/views_list_view.js +9 -9
- data/lib/frameworks/sproutcore/frameworks/ajax/system/request.js +167 -5
- data/lib/frameworks/sproutcore/frameworks/ajax/system/response.js +24 -8
- data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/stack_layout.js +737 -0
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/layout.js +0 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane.js +11 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/panes/pane_statechart.js +7 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/child_view_layout_protocol.js +8 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/observable_protocol.js +9 -6
- data/lib/frameworks/sproutcore/frameworks/{desktop/protocols/responder.js → core_foundation/protocols/responder_protocol.js} +83 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/{sparse_array_delegate.js → sparse_array_delegate_protocol.js} +11 -7
- data/lib/frameworks/sproutcore/frameworks/core_foundation/protocols/view_transition_protocol.js +11 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/color.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/page.js +0 -22
- data/lib/frameworks/sproutcore/frameworks/core_foundation/system/root_responder.js +61 -56
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/main_pane.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/pane/append_remove.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/animation.js +63 -39
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/border_frame_test.js +28 -28
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/createLayer.js +10 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layout.js +102 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutDidChange.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/layoutStyle.js +103 -103
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/replaceAllChildren_test.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view.js +77 -1
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/view_states_test.js +18 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view.js +42 -49
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/animation.js +5 -6
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/enabled.js +16 -5
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout.js +241 -102
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/layout_style.js +1 -4
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/manipulation.js +0 -11
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/statechart.js +993 -610
- data/lib/frameworks/sproutcore/frameworks/core_foundation/views/view/theming.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +6 -11
- data/lib/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +94 -27
- data/lib/frameworks/sproutcore/frameworks/datastore/system/query.js +133 -53
- data/lib/frameworks/sproutcore/frameworks/datastore/system/store.js +30 -35
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +3 -2
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/writeDataHash.js +73 -29
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/conflictedStoreKeys_test.js +156 -0
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/dataSourceCallbacks.js +61 -37
- data/lib/frameworks/sproutcore/frameworks/datastore/tests/system/store/find.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/datetime/frameworks/core/system/datetime.js +68 -39
- data/lib/frameworks/sproutcore/frameworks/designer/tests/coders/page.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/panel.js +8 -6
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/picker.js +80 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/panes/sheet.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drag_data_source.js → drag_data_source_protocol.js} +16 -10
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drag_source.js → drag_source_protocol.js} +28 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/protocols/{drop_target.js → drop_target_protocol.js} +73 -75
- data/lib/frameworks/sproutcore/frameworks/desktop/system/drag.js +4 -4
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/panes/panel/ui.js +39 -23
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +120 -97
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/list/rowSizeForContentIndex.js +26 -25
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/scroll/ui.js +3 -3
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/segmented/ui.js +5 -0
- data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/{dividers.js → dividers_test.js} +38 -38
- data/lib/frameworks/sproutcore/frameworks/desktop/views/collection.js +29 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/menu_scroll.js +2 -1
- data/lib/frameworks/sproutcore/frameworks/desktop/views/scroll_view.js +13 -18
- data/lib/frameworks/sproutcore/frameworks/desktop/views/segmented.js +41 -35
- data/lib/frameworks/sproutcore/frameworks/desktop/views/slider.js +14 -14
- data/lib/frameworks/sproutcore/frameworks/desktop/views/split.js +41 -26
- data/lib/frameworks/sproutcore/frameworks/desktop/views/static_content.js +2 -12
- data/lib/frameworks/sproutcore/frameworks/foundation/gestures/tap.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/auto_resize.js +14 -10
- data/lib/frameworks/sproutcore/frameworks/foundation/mixins/gesturable.js +104 -63
- data/lib/frameworks/sproutcore/frameworks/foundation/protocols/swap_transition_protocol.js +9 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_mixin_tests.js +1 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/mixins/auto_resize_test.js +33 -33
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/transitions/view_transitions_test.js +5 -5
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/methods.js +0 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/transition_test.js +0 -4
- data/lib/frameworks/sproutcore/frameworks/foundation/tests/views/container/ui.js +0 -2
- data/lib/frameworks/sproutcore/frameworks/foundation/views/text_field.js +12 -8
- data/lib/frameworks/sproutcore/frameworks/media/resources/silence.mp3 +0 -0
- data/lib/frameworks/sproutcore/frameworks/media/tests/audio.js +69 -0
- data/lib/frameworks/sproutcore/frameworks/media/views/audio.js +1 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/core.js +2 -2
- data/lib/frameworks/sproutcore/frameworks/runtime/mixins/observable.js +11 -4
- data/lib/frameworks/sproutcore/frameworks/runtime/protocols/mixin_protocol.js +150 -0
- data/lib/frameworks/sproutcore/frameworks/runtime/system/binding.js +447 -137
- data/lib/frameworks/sproutcore/frameworks/runtime/system/object.js +9 -15
- data/lib/frameworks/sproutcore/frameworks/runtime/system/set.js +19 -17
- data/lib/frameworks/sproutcore/frameworks/runtime/tests/system/binding.js +188 -16
- data/lib/frameworks/sproutcore/frameworks/statechart/system/state.js +1 -1
- data/lib/frameworks/sproutcore/frameworks/template_view/panes/template.js +0 -3
- data/lib/frameworks/sproutcore/frameworks/template_view/tests/panes/template.js +0 -17
- data/lib/frameworks/sproutcore/frameworks/template_view/tests/views/template/collection.js +43 -26
- data/lib/frameworks/sproutcore/frameworks/template_view/views/bindable_span.js +9 -2
- data/lib/frameworks/sproutcore/themes/ace/resources/collection/normal/list.css +0 -1
- data/lib/frameworks/sproutcore/themes/ace/resources/scroll/scroll.css +3 -0
- data/sproutcore.gemspec +3 -3
- metadata +19 -17
- data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/horizontal_stack_layout.js +0 -465
- data/lib/frameworks/sproutcore/frameworks/core_foundation/child_view_layouts/vertical_stack_layout.js +0 -472
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build.js +0 -87
- data/lib/frameworks/sproutcore/frameworks/core_foundation/tests/views/view/build_children.js +0 -89
@@ -314,13 +314,13 @@
|
|
314
314
|
SC.run(function() {
|
315
315
|
newContent = SC.View.create({ backgroundColor: 'blue' });
|
316
316
|
});
|
317
|
-
equals(newContent.get('viewState'), SC.
|
317
|
+
equals(newContent.get('viewState'), SC.CoreView.UNRENDERED, 'PRELIM: New view is unrendered');
|
318
318
|
|
319
319
|
SC.run(function() {
|
320
320
|
view.set('contentView', newContent);
|
321
321
|
});
|
322
322
|
ok(view.getPath('containerView.contentView') === newContent, 'New content has been successfully loaded into the container view.');
|
323
|
-
equals(newContent.get('viewState'), SC.
|
323
|
+
equals(newContent.get('viewState'), SC.CoreView.ATTACHED_SHOWN, 'New content has been rendered and attached.');
|
324
324
|
|
325
325
|
// Replacing the content view on an unrendered view.
|
326
326
|
SC.run(function() {
|
@@ -333,7 +333,7 @@
|
|
333
333
|
SC.run(function() {
|
334
334
|
view._doRender();
|
335
335
|
});
|
336
|
-
equals(newContent.get('viewState'), SC.
|
336
|
+
equals(newContent.get('viewState'), SC.CoreView.ATTACHED_PARTIAL, 'New content renders along with the rest of the view');
|
337
337
|
});
|
338
338
|
|
339
339
|
})();
|
@@ -157,6 +157,7 @@ var pane;
|
|
157
157
|
itemTitleKey: 'value',
|
158
158
|
itemValueKey: 'value',
|
159
159
|
itemWidthKey: 'width',
|
160
|
+
shouldHandleOverflow: true,
|
160
161
|
layout: { height: 25 }
|
161
162
|
})
|
162
163
|
.add("5_items,1_sel,widths,overflow", SC.SegmentedView, {
|
@@ -170,6 +171,7 @@ var pane;
|
|
170
171
|
itemTitleKey: 'value',
|
171
172
|
itemValueKey: 'value',
|
172
173
|
itemWidthKey: 'width',
|
174
|
+
shouldHandleOverflow: true,
|
173
175
|
value: "E",
|
174
176
|
layout: { height: 25 }
|
175
177
|
})
|
@@ -185,6 +187,7 @@ var pane;
|
|
185
187
|
itemValueKey: 'value',
|
186
188
|
itemWidthKey: 'width',
|
187
189
|
itemLayerIdKey: 'layerId',
|
190
|
+
shouldHandleOverflow: true,
|
188
191
|
value: "E",
|
189
192
|
layout: { height: 25 }
|
190
193
|
})
|
@@ -210,12 +213,14 @@ var pane;
|
|
210
213
|
items: "Item1 Item2 Item3".w(),
|
211
214
|
value: "Item2",
|
212
215
|
layout: { height: 25, width: 0 },
|
216
|
+
shouldHandleOverflow: true,
|
213
217
|
shouldAutoResize: YES
|
214
218
|
})
|
215
219
|
.add("3_items,1_sel,shouldAutoResize,flexible_layout", SC.SegmentedView, {
|
216
220
|
items: "Item1 Item2 Item3".w(),
|
217
221
|
value: "Item2",
|
218
222
|
layout: { height: 25, left: 0, right: 0 },
|
223
|
+
shouldHandleOverflow: true,
|
219
224
|
shouldAutoResize: YES
|
220
225
|
});
|
221
226
|
|
data/lib/frameworks/sproutcore/frameworks/desktop/tests/views/split/{dividers.js → dividers_test.js}
RENAMED
@@ -8,17 +8,17 @@
|
|
8
8
|
/*
|
9
9
|
Tests SplitView logic responsible for automatically creating divider views.
|
10
10
|
There are a few different parts to this:
|
11
|
-
|
11
|
+
|
12
12
|
- The automatic creation of dividers.
|
13
13
|
- The splitDividerView property.
|
14
14
|
- The splitViewDividerBetween method.
|
15
15
|
|
16
16
|
We don't have to worry about orientation; the code being tested creates
|
17
17
|
child views, but does nothing related to laying them out.
|
18
|
-
|
18
|
+
|
19
19
|
Note: We do NOT test the properties added to the split children (nextView, etc.);
|
20
20
|
Those are tested in children.js.
|
21
|
-
|
21
|
+
|
22
22
|
*/
|
23
23
|
var createSplitView;
|
24
24
|
|
@@ -31,13 +31,13 @@ module("SplitView Dividers", {
|
|
31
31
|
'left',
|
32
32
|
'right'
|
33
33
|
],
|
34
|
-
|
34
|
+
|
35
35
|
left: SC.View.extend(SC.SplitChild, { name: 'left', canCollapse: YES, collapseAtSize: 50 }),
|
36
36
|
right: SC.View.extend(SC.SplitChild, { name: 'right', canCollapse: YES, collapseAtSize: 50 }),
|
37
|
-
|
37
|
+
|
38
38
|
layout: { left: 0, top: 0, width: 500, height: 500 }
|
39
39
|
});
|
40
|
-
|
40
|
+
|
41
41
|
createSplitView = function(opts) {
|
42
42
|
opts = opts || {};
|
43
43
|
SC.RunLoop.begin();
|
@@ -46,9 +46,9 @@ module("SplitView Dividers", {
|
|
46
46
|
return ret;
|
47
47
|
};
|
48
48
|
},
|
49
|
-
|
49
|
+
|
50
50
|
teardown: function() {
|
51
|
-
|
51
|
+
|
52
52
|
}
|
53
53
|
});
|
54
54
|
|
@@ -75,16 +75,16 @@ test("SC.SplitDividerView uses splitViewDividerBetween method", function(){
|
|
75
75
|
test("splitViewDividerBetween works properly", function(){
|
76
76
|
var MyDividerType1 = SC.SplitDividerView.extend({ dividerType: 1 });
|
77
77
|
var MyDividerType2 = SC.SplitDividerView.extend({ dividerType: 2 });
|
78
|
-
|
78
|
+
|
79
79
|
var view = createSplitView({
|
80
80
|
childViews: 'left middle right'.w(),
|
81
81
|
middle: SC.View.design(SC.SplitChild, { name: 'middle' }),
|
82
|
-
splitViewDividerBetween: function(split, view1, view2) {
|
82
|
+
splitViewDividerBetween: function(split, view1, view2) {
|
83
83
|
if (view1 === split.left) return MyDividerType1.create();
|
84
84
|
if (view1 === split.middle) return MyDividerType2.create();
|
85
|
-
}
|
85
|
+
}
|
86
86
|
});
|
87
|
-
|
87
|
+
|
88
88
|
equals(view.childViews.length, 5, "Should have created 5 views: left, divider, middle, divider, and right.");
|
89
89
|
ok(view.childViews[1].kindOf(MyDividerType1), "2nd view is a MyDividerType1");
|
90
90
|
ok(view.childViews[3].kindOf(MyDividerType2), "4th view is a MyDividerType2");
|
@@ -92,12 +92,12 @@ test("splitViewDividerBetween works properly", function(){
|
|
92
92
|
|
93
93
|
function checkDividers(view, number) {
|
94
94
|
var shouldBeDivider = NO;
|
95
|
-
|
95
|
+
|
96
96
|
equals(view.childViews.length, number * 2 - 1, "There should be " + (number * 2 - 1) + " children");
|
97
|
-
|
97
|
+
|
98
98
|
for (var i = 1; i < number; i++) {
|
99
99
|
equals(
|
100
|
-
view.childViews[i - 1].isSplitDivider, shouldBeDivider,
|
100
|
+
view.childViews[i - 1].isSplitDivider, shouldBeDivider,
|
101
101
|
"View " + i + (shouldBeDivider ? " SHOULD " : " SHOULD NOT ") + "be a divider"
|
102
102
|
);
|
103
103
|
shouldBeDivider = !shouldBeDivider;
|
@@ -109,26 +109,26 @@ test("Adding/removing from end adds/removes dividers appropriately", function()
|
|
109
109
|
childViews: 'left middle right'.w(),
|
110
110
|
middle: SC.View.design(SC.SplitChild, { name: 'middle' })
|
111
111
|
});
|
112
|
-
|
112
|
+
|
113
113
|
// do an initial check: should be three views with dividers.
|
114
114
|
checkDividers(view, 3);
|
115
|
-
|
115
|
+
|
116
116
|
// add one, and check again.
|
117
117
|
var add = SC.View.create(SC.SplitChild, { name: 'add' });
|
118
|
-
|
118
|
+
|
119
119
|
SC.RunLoop.begin();
|
120
120
|
view.appendChild(add);
|
121
121
|
SC.RunLoop.end();
|
122
|
-
|
122
|
+
|
123
123
|
checkDividers(view, 4);
|
124
|
-
|
124
|
+
|
125
125
|
// remove the one we added, and check again
|
126
126
|
SC.RunLoop.begin();
|
127
127
|
view.removeChild(add);
|
128
128
|
SC.RunLoop.end();
|
129
|
-
|
129
|
+
|
130
130
|
checkDividers(view, 3);
|
131
|
-
|
131
|
+
|
132
132
|
});
|
133
133
|
|
134
134
|
test("Adding/removing from beginning adds/removes dividers appropriately", function() {
|
@@ -136,26 +136,26 @@ test("Adding/removing from beginning adds/removes dividers appropriately", funct
|
|
136
136
|
childViews: 'left middle right'.w(),
|
137
137
|
middle: SC.View.design(SC.SplitChild, { name: 'middle' })
|
138
138
|
});
|
139
|
-
|
139
|
+
|
140
140
|
// do an initial check: should be three views with dividers.
|
141
141
|
checkDividers(view, 3);
|
142
|
-
|
142
|
+
|
143
143
|
// add one, and check again.
|
144
144
|
var add = SC.View.create(SC.SplitChild, { name: 'add' });
|
145
|
-
|
145
|
+
|
146
146
|
SC.RunLoop.begin();
|
147
147
|
view.insertBefore(add, view.childViews[0]);
|
148
148
|
SC.RunLoop.end();
|
149
|
-
|
149
|
+
|
150
150
|
checkDividers(view, 4);
|
151
|
-
|
151
|
+
|
152
152
|
// remove the one we added, and check again
|
153
153
|
SC.RunLoop.begin();
|
154
154
|
view.removeChild(add);
|
155
155
|
SC.RunLoop.end();
|
156
|
-
|
156
|
+
|
157
157
|
checkDividers(view, 3);
|
158
|
-
|
158
|
+
|
159
159
|
});
|
160
160
|
|
161
161
|
test("Adding/removing in middle adds/removes dividers appropriately", function() {
|
@@ -163,26 +163,26 @@ test("Adding/removing in middle adds/removes dividers appropriately", function()
|
|
163
163
|
childViews: 'left middle right'.w(),
|
164
164
|
middle: SC.View.design(SC.SplitChild, { name: 'middle' })
|
165
165
|
});
|
166
|
-
|
166
|
+
|
167
167
|
// do an initial check: should be three views with dividers.
|
168
168
|
checkDividers(view, 3);
|
169
|
-
|
169
|
+
|
170
170
|
// add one, and check again.
|
171
171
|
var add = SC.View.create(SC.SplitChild, { name: 'add' });
|
172
|
-
|
172
|
+
|
173
173
|
SC.RunLoop.begin();
|
174
174
|
view.insertBefore(add, view.childViews[2]); // note: 2 is the middle view
|
175
175
|
SC.RunLoop.end();
|
176
|
-
|
176
|
+
|
177
177
|
checkDividers(view, 4);
|
178
|
-
|
178
|
+
|
179
179
|
// remove the one we added, and check again
|
180
180
|
SC.RunLoop.begin();
|
181
181
|
view.removeChild(add);
|
182
182
|
SC.RunLoop.end();
|
183
|
-
|
183
|
+
|
184
184
|
checkDividers(view, 3);
|
185
|
-
|
185
|
+
|
186
186
|
});
|
187
187
|
|
188
188
|
test("Adding and removing before a divider doesn't screw things majorly", function() {
|
@@ -231,14 +231,14 @@ test("Adding and removing several views doesn't screw things up", function() {
|
|
231
231
|
SC.RunLoop.begin();
|
232
232
|
view.removeChild(view.childViews[2]);
|
233
233
|
view.removeChild(view.childViews[3]);
|
234
|
-
|
234
|
+
|
235
235
|
// semi-random (I just picked 4 numbers):
|
236
236
|
view.insertBefore(add1, view.childViews[0]);
|
237
237
|
view.insertBefore(add2, view.childViews[0]);
|
238
238
|
view.insertBefore(add3, view.childViews[4]);
|
239
239
|
view.insertBefore(add4, view.childViews[3]);
|
240
240
|
SC.RunLoop.end();
|
241
|
-
|
241
|
+
|
242
242
|
checkDividers(view, 5);
|
243
243
|
});
|
244
244
|
|
@@ -2081,6 +2081,24 @@ SC.CollectionView = SC.View.extend(SC.ActionSupport, SC.CollectionViewDelegate,
|
|
2081
2081
|
// MOUSE EVENTS
|
2082
2082
|
//
|
2083
2083
|
|
2084
|
+
doubleClick: function (ev) {
|
2085
|
+
var isEnabledInPane = this.get('isEnabledInPane'),
|
2086
|
+
handled = false;
|
2087
|
+
|
2088
|
+
if (isEnabledInPane) {
|
2089
|
+
var action = this.get('action');
|
2090
|
+
|
2091
|
+
if (action) {
|
2092
|
+
var itemView = this.itemViewForEvent(ev);
|
2093
|
+
|
2094
|
+
this._cv_performSelectAction(itemView, ev, 0, ev.clickCount);
|
2095
|
+
handled = true;
|
2096
|
+
}
|
2097
|
+
}
|
2098
|
+
|
2099
|
+
return handled;
|
2100
|
+
},
|
2101
|
+
|
2084
2102
|
/** @private
|
2085
2103
|
Handles mouse down events on the collection view or on any of its
|
2086
2104
|
children.
|
@@ -2259,21 +2277,18 @@ SC.CollectionView = SC.View.extend(SC.ActionSupport, SC.CollectionViewDelegate,
|
|
2259
2277
|
} else if (info) {
|
2260
2278
|
var idx = info.contentIndex;
|
2261
2279
|
|
2262
|
-
//
|
2263
|
-
// selectOnMouseDown was NO.
|
2280
|
+
// This will be set if the user simply clicked on an unselected item and selectOnMouseDown was NO.
|
2264
2281
|
if (info.shouldSelect) {
|
2265
2282
|
this.select(idx, info.modifierKeyPressed);
|
2266
2283
|
didSelect = true;
|
2267
2284
|
}
|
2268
2285
|
|
2269
|
-
// This is true if the user clicked on a selected item with a modifier
|
2270
|
-
// key pressed.
|
2286
|
+
// This is true if the user clicked on a selected item with a modifier key pressed.
|
2271
2287
|
if (info.shouldDeselect) this.deselect(idx);
|
2272
2288
|
|
2273
|
-
// This is true if the user clicked on a selected item without a
|
2274
|
-
//
|
2275
|
-
//
|
2276
|
-
// selection and reselect the clicked on item.
|
2289
|
+
// This is true if the user clicked on a selected item without a modifier-key pressed.
|
2290
|
+
// When this happens we try to begin editing on the content. If that is not allowed, then
|
2291
|
+
// simply clear the selection and reselect the clicked on item.
|
2277
2292
|
if (info.shouldReselect) {
|
2278
2293
|
|
2279
2294
|
// - contentValueIsEditable is true
|
@@ -2322,7 +2337,7 @@ SC.CollectionView = SC.View.extend(SC.ActionSupport, SC.CollectionViewDelegate,
|
|
2322
2337
|
// Track that mouse is up no matter what (e.g. mouse went down and then view was disabled before mouse up).
|
2323
2338
|
this._sc_isMouseDown = false;
|
2324
2339
|
|
2325
|
-
return false; // Bubble event to allow
|
2340
|
+
return false; // Bubble event to allow doubleClick to be called.
|
2326
2341
|
},
|
2327
2342
|
|
2328
2343
|
/** @private */
|
@@ -2753,7 +2768,7 @@ SC.CollectionView = SC.View.extend(SC.ActionSupport, SC.CollectionViewDelegate,
|
|
2753
2768
|
},
|
2754
2769
|
|
2755
2770
|
/**
|
2756
|
-
Implements the SC.
|
2771
|
+
Implements the SC.DropTargetProtocol interface. The default implementation will
|
2757
2772
|
consult the collection view delegate, if you implement those methods.
|
2758
2773
|
|
2759
2774
|
This method is called once when the drag enters the view area. It's
|
@@ -2899,7 +2914,7 @@ SC.CollectionView = SC.View.extend(SC.ActionSupport, SC.CollectionViewDelegate,
|
|
2899
2914
|
},
|
2900
2915
|
|
2901
2916
|
/**
|
2902
|
-
Implements the SC.
|
2917
|
+
Implements the SC.DropTargetProtocol interface. The default implementation will
|
2903
2918
|
determine the drop location and then consult the collection view delegate
|
2904
2919
|
if you implement those methods. Otherwise it will handle reordering
|
2905
2920
|
content on its own.
|
@@ -2933,7 +2948,7 @@ SC.CollectionView = SC.View.extend(SC.ActionSupport, SC.CollectionViewDelegate,
|
|
2933
2948
|
},
|
2934
2949
|
|
2935
2950
|
/**
|
2936
|
-
Implements the SC.
|
2951
|
+
Implements the SC.DropTargetProtocol protocol. Hides any visible insertion
|
2937
2952
|
point and clears some cached values.
|
2938
2953
|
*/
|
2939
2954
|
dragEnded: function () {
|
@@ -2942,7 +2957,7 @@ SC.CollectionView = SC.View.extend(SC.ActionSupport, SC.CollectionViewDelegate,
|
|
2942
2957
|
},
|
2943
2958
|
|
2944
2959
|
/**
|
2945
|
-
Implements the SC.
|
2960
|
+
Implements the SC.DropTargetProtocol protocol.
|
2946
2961
|
|
2947
2962
|
@returns {Boolean} YES
|
2948
2963
|
*/
|
@@ -2951,7 +2966,7 @@ SC.CollectionView = SC.View.extend(SC.ActionSupport, SC.CollectionViewDelegate,
|
|
2951
2966
|
},
|
2952
2967
|
|
2953
2968
|
/**
|
2954
|
-
Implements the SC.
|
2969
|
+
Implements the SC.DropTargetProtocol protocol. Consults the collection view
|
2955
2970
|
delegate to actually perform the operation unless the operation is
|
2956
2971
|
reordering content.
|
2957
2972
|
|
@@ -211,6 +211,7 @@ SC.MenuScrollView = SC.ScrollView.extend(
|
|
211
211
|
controlSize: controlSize,
|
212
212
|
scrollDown: false,
|
213
213
|
isVisible: !autohidesVerticalScroller,
|
214
|
+
layout: { height: 0 },
|
214
215
|
|
215
216
|
value: this.get('verticalScrollOffset'),
|
216
217
|
valueBinding: '.owner.verticalScrollOffset', // Bind the value of the scroller to our vertical offset.
|
@@ -238,7 +239,7 @@ SC.MenuScrollView = SC.ScrollView.extend(
|
|
238
239
|
controlSize: controlSize,
|
239
240
|
scrollDown: true,
|
240
241
|
isVisible: !autohidesVerticalScroller,
|
241
|
-
layout: { bottom: 0 },
|
242
|
+
layout: { bottom: 0, height: 0 },
|
242
243
|
|
243
244
|
value: this.get('verticalScrollOffset'),
|
244
245
|
valueBinding: '.owner.verticalScrollOffset', // Bind the value of the scroller to our vertical offset.
|
@@ -109,7 +109,7 @@ SC.ScrollView = SC.View.extend({
|
|
109
109
|
_sc_contentHeightDidChange: false,
|
110
110
|
|
111
111
|
/** @private The cached scale of the content. */
|
112
|
-
_sc_contentScale:
|
112
|
+
_sc_contentScale: undefined,
|
113
113
|
|
114
114
|
/** @private Flag used to react accordingly when the content's scale changes. */
|
115
115
|
_sc_contentScaleDidChange: false,
|
@@ -184,7 +184,7 @@ SC.ScrollView = SC.View.extend({
|
|
184
184
|
_sc_passTouchToContentTimer: null,
|
185
185
|
|
186
186
|
/** @private The actual scale. */
|
187
|
-
_sc_scale:
|
187
|
+
_sc_scale: 1,
|
188
188
|
|
189
189
|
/** @private Flag used to indicate when we should resize the content width manually. */
|
190
190
|
// _sc_shouldResizeContentWidth: false,
|
@@ -645,11 +645,6 @@ SC.ScrollView = SC.View.extend({
|
|
645
645
|
}
|
646
646
|
} else {
|
647
647
|
value = this._sc_scale;
|
648
|
-
|
649
|
-
// Default value.
|
650
|
-
if (value == null) {
|
651
|
-
value = 1;
|
652
|
-
}
|
653
648
|
}
|
654
649
|
|
655
650
|
// Update the actual value.
|
@@ -875,7 +870,7 @@ SC.ScrollView = SC.View.extend({
|
|
875
870
|
contentViewLayout = contentView.get('layout'),
|
876
871
|
leftStart = contentViewLayout.left,
|
877
872
|
leftDelta = contentAdjustMap.left - leftStart,
|
878
|
-
scaleStart = contentViewLayout.scale,
|
873
|
+
scaleStart = contentViewLayout.scale == null ? 1 : contentViewLayout.scale,
|
879
874
|
scaleDelta = contentAdjustMap.scale - scaleStart,
|
880
875
|
topStart = contentViewLayout.top,
|
881
876
|
topDelta = contentAdjustMap.top - topStart,
|
@@ -990,7 +985,7 @@ SC.ScrollView = SC.View.extend({
|
|
990
985
|
// this._sc_shouldResizeContentHeight = false;
|
991
986
|
this._sc_contentHeight = 0;
|
992
987
|
this._sc_contentWidth = 0;
|
993
|
-
this._sc_contentScale =
|
988
|
+
this._sc_contentScale = undefined;
|
994
989
|
|
995
990
|
// Assign the content view to our container view. This ensures that it is instantiated.
|
996
991
|
containerView.set('contentView', newView);
|
@@ -1003,12 +998,6 @@ SC.ScrollView = SC.View.extend({
|
|
1003
998
|
// newView.addObserver('layer', this, layerChangeFunc);
|
1004
999
|
|
1005
1000
|
if (!newView.useStaticLayout) {
|
1006
|
-
// Ensure that scale transforms occur from the top-left corner (per our math).
|
1007
|
-
newView.adjust({
|
1008
|
-
transformOriginX: 0,
|
1009
|
-
transformOriginY: 0
|
1010
|
-
});
|
1011
|
-
|
1012
1001
|
// When a view wants an accelerated layer and isn't a fixed size, we convert it to a fixed
|
1013
1002
|
// size and resize it when our container resizes.
|
1014
1003
|
// if (newView.get('wantsAcceleratedLayer') && !newView.get('isFixedSize')) {
|
@@ -1126,7 +1115,7 @@ SC.ScrollView = SC.View.extend({
|
|
1126
1115
|
if (this._sc_gestureAnchorHOffset != null) {
|
1127
1116
|
this._sc_gestureAnchorHOffset = value;
|
1128
1117
|
}
|
1129
|
-
} else {
|
1118
|
+
} else if (this.get('canScrollHorizontal')) {
|
1130
1119
|
// Take alignment into account.
|
1131
1120
|
var horizontalAlign = this.get('horizontalAlign'),
|
1132
1121
|
horizontalScrollOffset = this._sc_horizontalScrollOffset,
|
@@ -1185,7 +1174,7 @@ SC.ScrollView = SC.View.extend({
|
|
1185
1174
|
if (this._sc_gestureAnchorVOffset != null) {
|
1186
1175
|
this._sc_gestureAnchorVOffset = value;
|
1187
1176
|
}
|
1188
|
-
} else {
|
1177
|
+
} else if (this.get('canScrollVertical')) {
|
1189
1178
|
var verticalAlign = this.get('verticalAlign'),
|
1190
1179
|
verticalScrollOffset = this._sc_verticalScrollOffset,
|
1191
1180
|
minimumVerticalScrollOffset = this.get('minimumVerticalScrollOffset');
|
@@ -1439,7 +1428,13 @@ SC.ScrollView = SC.View.extend({
|
|
1439
1428
|
var contentAdjustMap = SC.ScrollView._SC_CONTENT_ADJUST_MAP; // Shared object used to avoid continually initializing/destroying objects.
|
1440
1429
|
|
1441
1430
|
// Create the content adjust map once. Note: This is a shared object, all properties must be overwritten each time.
|
1442
|
-
if (!contentAdjustMap) {
|
1431
|
+
if (!contentAdjustMap) {
|
1432
|
+
contentAdjustMap = SC.ScrollView._SC_CONTENT_ADJUST_MAP = {
|
1433
|
+
// Ensure that scale transforms occur from the top-left corner (per our math).
|
1434
|
+
transformOriginX: 0,
|
1435
|
+
transformOriginY: 0
|
1436
|
+
};
|
1437
|
+
}
|
1443
1438
|
|
1444
1439
|
contentAdjustMap.left = left;
|
1445
1440
|
contentAdjustMap.top = top;
|