sproutit-sproutcore 1.0.20090721145281 → 1.0.20090721145282
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Buildfile +4 -3
- data/VERSION.yml +2 -2
- data/buildtasks/entry.rake +3 -0
- data/buildtasks/manifest.rake +35 -9
- data/buildtasks/target.rake +25 -6
- data/frameworks/sproutcore/Buildfile +10 -0
- data/frameworks/sproutcore/frameworks/datastore/data_sources/data_source.js +41 -20
- data/frameworks/sproutcore/frameworks/datastore/data_sources/fixtures.js +14 -43
- data/frameworks/sproutcore/frameworks/datastore/models/record.js +11 -0
- data/frameworks/sproutcore/frameworks/datastore/models/record_attribute.js +6 -3
- data/frameworks/sproutcore/frameworks/datastore/system/nested_store.js +5 -1
- data/frameworks/sproutcore/frameworks/datastore/system/query.js +10 -7
- data/frameworks/sproutcore/frameworks/datastore/system/record_array.js +19 -20
- data/frameworks/sproutcore/frameworks/datastore/system/store.js +126 -93
- data/frameworks/sproutcore/frameworks/datastore/tests/data_sources/fixtures.js +9 -3
- data/frameworks/sproutcore/frameworks/datastore/tests/models/many_attribute.js +6 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/core_methods.js +28 -3
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/destroy.js +13 -5
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/storeDidChangeProperties.js +46 -23
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record/writeAttribute.js +29 -5
- data/frameworks/sproutcore/frameworks/datastore/tests/models/record_attribute.js +13 -4
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/chain.js +109 -0
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChanges.js +69 -15
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/commitChangesFromNestedStore.js +20 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/nested_store/dataHashDidChange.js +4 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/query/find_all.js +56 -6
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/commitRecord.js +9 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/core_methods.js +45 -2
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/recordDidChange.js +0 -1
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/retrieveRecord.js +53 -6
- data/frameworks/sproutcore/frameworks/datastore/tests/system/store/writeDataHash.js +0 -5
- data/frameworks/sproutcore/frameworks/desktop/panes/menu.js +47 -27
- data/frameworks/sproutcore/frameworks/desktop/system/drag.js +5 -4
- data/frameworks/sproutcore/frameworks/desktop/tests/views/collection/mouse.js +23 -12
- data/frameworks/sproutcore/frameworks/desktop/tests/views/list/render.js +92 -0
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/methods.js +104 -53
- data/frameworks/sproutcore/frameworks/desktop/tests/views/select_field/ui.js +2 -0
- data/frameworks/sproutcore/frameworks/desktop/views/button.js +4 -3
- data/frameworks/sproutcore/frameworks/desktop/views/collection.js +6 -2
- data/frameworks/sproutcore/frameworks/desktop/views/list.js +9 -0
- data/frameworks/sproutcore/frameworks/desktop/views/list_item.js +2 -2
- data/frameworks/sproutcore/frameworks/desktop/views/menu_item.js +3 -3
- data/frameworks/sproutcore/frameworks/desktop/views/popup_button.js +9 -1
- data/frameworks/sproutcore/frameworks/desktop/views/select_field.js +80 -102
- data/frameworks/sproutcore/frameworks/foundation/controllers/array.js +0 -1
- data/frameworks/sproutcore/frameworks/foundation/english.lproj/text_field.css +5 -1
- data/frameworks/sproutcore/frameworks/foundation/panes/pane.js +8 -1
- data/frameworks/sproutcore/frameworks/foundation/private/tree_item_observer.js +0 -1
- data/frameworks/sproutcore/frameworks/foundation/system/datetime.js +31 -3
- data/frameworks/sproutcore/frameworks/foundation/system/event.js +0 -4
- data/frameworks/sproutcore/frameworks/foundation/system/render_context.js +3 -7
- data/frameworks/sproutcore/frameworks/foundation/system/request.js +3 -4
- data/frameworks/sproutcore/frameworks/foundation/system/user_defaults.js +78 -17
- data/frameworks/sproutcore/frameworks/foundation/system/utils.js +9 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/controllers/array/single_case.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/system/core_query/jquery_selector.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/system/datetime.js +5 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/system/request.js +2 -2
- data/frameworks/sproutcore/frameworks/foundation/tests/system/user_defaults.js +1 -4
- data/frameworks/sproutcore/frameworks/foundation/tests/validators/validator.js +20 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/image/ui.js +13 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/ui.js +132 -0
- data/frameworks/sproutcore/frameworks/foundation/tests/views/view/isVisibleInWindow.js +6 -3
- data/frameworks/sproutcore/frameworks/foundation/validators/validator.js +8 -5
- data/frameworks/sproutcore/frameworks/foundation/views/image.js +18 -5
- data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +292 -21
- data/frameworks/sproutcore/frameworks/foundation/views/view.js +13 -14
- data/frameworks/sproutcore/frameworks/mini/license.js +28 -0
- data/frameworks/sproutcore/frameworks/runtime/core.js +35 -0
- data/frameworks/sproutcore/frameworks/runtime/mixins/enumerable.js +1 -1
- data/frameworks/sproutcore/frameworks/runtime/system/sparse_array.js +79 -5
- data/frameworks/sproutcore/frameworks/runtime/tests/mixins/enumerable.js +6 -6
- data/frameworks/sproutcore/frameworks/runtime/tests/system/sparse_array.js +53 -0
- data/frameworks/sproutcore/frameworks/testing/system/plan.js +4 -0
- data/frameworks/sproutcore/frameworks/testing/system/runner.js +1 -1
- data/frameworks/sproutcore/themes/standard_theme/english.lproj/radio.css +4 -0
- data/gen/design/Buildfile +23 -0
- data/gen/design/README +1 -0
- data/gen/design/USAGE +10 -0
- data/gen/design/templates/english.lproj/@filename@.js +16 -0
- data/gen/page/Buildfile +36 -0
- data/gen/page/README +1 -0
- data/gen/page/USAGE +15 -0
- data/gen/page/templates/pages/@target_name@/Buildfile +16 -0
- data/gen/page/templates/pages/@target_name@/core.js +22 -0
- data/gen/page/templates/pages/@target_name@/english.lproj/body.css +1 -0
- data/gen/page/templates/pages/@target_name@/english.lproj/body.rhtml +7 -0
- data/gen/page/templates/pages/@target_name@/english.lproj/strings.js +15 -0
- data/gen/view/README +1 -1
- data/gen/view/USAGE +5 -5
- data/lib/sproutcore/builders/base.rb +13 -2
- data/lib/sproutcore/builders/html.rb +28 -1
- data/lib/sproutcore/builders/minify.rb +84 -18
- data/lib/sproutcore/builders/test.rb +2 -1
- data/lib/sproutcore/helpers/entry_sorter.rb +16 -1
- data/lib/sproutcore/helpers/static_helper.rb +32 -4
- data/lib/sproutcore/helpers/tag_helper.rb +65 -0
- data/lib/sproutcore/models/manifest.rb +40 -6
- data/lib/sproutcore/models/target.rb +12 -3
- data/lib/sproutcore/rack/builder.rb +56 -4
- data/lib/sproutcore/tools/manifest.rb +1 -0
- data/lib/sproutcore/tools/server.rb +1 -0
- data/lib/sproutcore/tools.rb +21 -1
- data/lib/sproutcore.rb +13 -0
- metadata +16 -1
@@ -54,7 +54,7 @@ module("SC.CollectionView Mouse Events", {
|
|
54
54
|
@param {IndexSet} expected expected selection
|
55
55
|
@returns {void}
|
56
56
|
*/
|
57
|
-
function clickOn(view, index, shiftKey, ctrlKey, expected) {
|
57
|
+
function clickOn(view, index, shiftKey, ctrlKey, expected, delay) {
|
58
58
|
var itemView = view.getPath('childViews.%@'.fmt(index)),
|
59
59
|
layer = itemView.get('layer'),
|
60
60
|
opts = { shiftKey: shiftKey, ctrlKey: ctrlKey },
|
@@ -69,15 +69,26 @@ function clickOn(view, index, shiftKey, ctrlKey, expected) {
|
|
69
69
|
SC.Event.trigger(layer, 'mouseup', [ev]);
|
70
70
|
|
71
71
|
if (expected !== undefined) {
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
72
|
+
var f = function() {
|
73
|
+
SC.RunLoop.begin();
|
74
|
+
sel = view.get('selection');
|
75
|
+
|
76
|
+
modifiers = [];
|
77
|
+
if (shiftKey) modifiers.push('shift');
|
78
|
+
if (ctrlKey) modifiers.push('ctrl');
|
79
|
+
modifiers = modifiers.length > 0 ? modifiers.join('+') : 'no modifiers';
|
80
|
+
|
81
|
+
expected = SC.SelectionSet.create().add(view.get('content'), expected);
|
82
|
+
|
83
|
+
ok(expected.isEqual(sel), 'should have selection: %@ after click with %@ on item[%@], actual: %@'.fmt(expected, modifiers, index, sel));
|
84
|
+
SC.RunLoop.end();
|
85
|
+
if (delay) window.start() ; // starts the test runner
|
86
|
+
};
|
78
87
|
|
79
|
-
|
80
|
-
|
88
|
+
if (delay) {
|
89
|
+
stop() ; // stops the test runner
|
90
|
+
setTimeout(f, delay) ;
|
91
|
+
} else f() ;
|
81
92
|
}
|
82
93
|
|
83
94
|
layer = itemView = null ;
|
@@ -91,11 +102,11 @@ test("clicking on an item should select it", function() {
|
|
91
102
|
clickOn(view, 3, NO, NO, SC.IndexSet.create(3));
|
92
103
|
});
|
93
104
|
|
94
|
-
test("clicking on a selected item should clear selection and reselect it
|
95
|
-
|
105
|
+
test("clicking on a selected item should clear selection after 301ms and reselect it", function() {
|
96
106
|
view.select(SC.IndexSet.create(1,5));
|
97
107
|
SC.stopIt = YES ;
|
98
|
-
|
108
|
+
SC.RootResponder.responder._lastMouseUpAt = null ; // HACK: don't want a doubleClick from previous tests
|
109
|
+
clickOn(view, 3, NO, NO, SC.IndexSet.create(3), 301);
|
99
110
|
SC.stopIt = NO ;
|
100
111
|
});
|
101
112
|
|
@@ -0,0 +1,92 @@
|
|
1
|
+
// ==========================================================================
|
2
|
+
// Project: SproutCore - JavaScript Application Framework
|
3
|
+
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
|
4
|
+
// portions copyright @2009 Apple, Inc.
|
5
|
+
// License: Licened under MIT license (see license.js)
|
6
|
+
// ==========================================================================
|
7
|
+
|
8
|
+
// SC.LOG_BINDINGS = YES ;
|
9
|
+
|
10
|
+
var view, content, pane ;
|
11
|
+
|
12
|
+
var renderFunc = CoreTest.stub("render", function() {
|
13
|
+
SC.ListItemView.prototype.render.apply(this, arguments) ;
|
14
|
+
});
|
15
|
+
|
16
|
+
module("SC.ListView.render", {
|
17
|
+
|
18
|
+
setup: function() {
|
19
|
+
SC.RunLoop.begin();
|
20
|
+
|
21
|
+
content = "1 2 3 4 5 6 7 8 9 10".w().map(function(x) {
|
22
|
+
return SC.Object.create({ value: x });
|
23
|
+
});
|
24
|
+
|
25
|
+
view = SC.ListView.create({
|
26
|
+
content: content,
|
27
|
+
|
28
|
+
layout: { top: 0, left: 0, width: 300, height: 500 },
|
29
|
+
|
30
|
+
layoutForContentIndex: function(idx) {
|
31
|
+
return { left: 0, right: 0, top: idx * 50, height: 50 };
|
32
|
+
},
|
33
|
+
|
34
|
+
didReload: CoreTest.stub("didReload"),
|
35
|
+
|
36
|
+
_cv_isVisibleInWindowDidChange: CoreTest.stub("_cv_isVisibleInWindowDidChange", function() {
|
37
|
+
SC.ListView.prototype._cv_isVisibleInWindowDidChange.apply(this, arguments) ;
|
38
|
+
}),
|
39
|
+
|
40
|
+
_cv_nowShowingDidChange: CoreTest.stub("_cv_nowShowingDidChange", function() {
|
41
|
+
SC.ListView.prototype._cv_nowShowingDidChange.apply(this, arguments) ;
|
42
|
+
}),
|
43
|
+
|
44
|
+
exampleView: SC.ListItemView.extend({
|
45
|
+
render: renderFunc
|
46
|
+
}),
|
47
|
+
|
48
|
+
// reset stubs
|
49
|
+
reset: function() {
|
50
|
+
this.didReload.reset();
|
51
|
+
this._cv_isVisibleInWindowDidChange.reset();
|
52
|
+
this._cv_nowShowingDidChange.reset();
|
53
|
+
renderFunc.reset();
|
54
|
+
}
|
55
|
+
|
56
|
+
});
|
57
|
+
|
58
|
+
pane = SC.MainPane.create();
|
59
|
+
pane.appendChild(view);
|
60
|
+
pane.append();
|
61
|
+
|
62
|
+
SC.RunLoop.end();
|
63
|
+
},
|
64
|
+
|
65
|
+
teardown: function() {
|
66
|
+
SC.RunLoop.begin();
|
67
|
+
pane.remove();
|
68
|
+
SC.RunLoop.end();
|
69
|
+
view.reset();
|
70
|
+
}
|
71
|
+
|
72
|
+
});
|
73
|
+
|
74
|
+
// ..........................................................
|
75
|
+
// BASIC TESTS
|
76
|
+
//
|
77
|
+
|
78
|
+
test("didReload() should only be called once with a static content array", function() {
|
79
|
+
view.didReload.expect(1);
|
80
|
+
});
|
81
|
+
|
82
|
+
test("_cv_isVisibleInWindowDidChange() should only be called once with a static content array", function() {
|
83
|
+
view._cv_isVisibleInWindowDidChange.expect(1);
|
84
|
+
});
|
85
|
+
|
86
|
+
test("list item render() should only be called once per item view a static content array", function() {
|
87
|
+
renderFunc.expect(10);
|
88
|
+
});
|
89
|
+
|
90
|
+
// test("_cv_nowShowingDidChange() should only be called once with a static content array", function() {
|
91
|
+
// view._cv_nowShowingDidChange.expect(1); // currently is 3...
|
92
|
+
// });
|
@@ -7,75 +7,126 @@
|
|
7
7
|
|
8
8
|
/*global module test htmlbody ok equals same stop start */
|
9
9
|
|
10
|
-
var pane, view ;
|
10
|
+
var pane, view , view1, view2, view3;
|
11
11
|
module("SC.SelectFieldView",{
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
12
|
+
setup: function() {
|
13
|
+
SC.RunLoop.begin();
|
14
|
+
pane = SC.MainPane.create({
|
15
|
+
objs : ["Apple","Sproutcore 1.0","Development","Charles"],
|
16
|
+
selectedValue: "Apple",
|
17
|
+
childViews: [
|
18
|
+
SC.SelectFieldView.extend({
|
19
|
+
objects: [1,6,11,2,8]
|
20
|
+
}),
|
21
|
+
SC.SelectFieldView.extend({
|
22
|
+
objects: ["Apple","Sproutcore 1.0","Development","Charles"]
|
23
|
+
}),
|
24
|
+
SC.SelectFieldView.extend({
|
25
|
+
objectsBinding: '*owner.objs',
|
26
|
+
valueBinding: '*owner.selectedValue'
|
27
|
+
}),
|
28
|
+
SC.SelectFieldView.extend({
|
29
|
+
objectsBinding: '*owner.objs',
|
30
|
+
valueBinding: '*owner.selectedValue',
|
31
|
+
valueKey: 'title',
|
32
|
+
nameKey: 'title',
|
33
|
+
sortKey: 'pos'
|
34
|
+
})
|
35
|
+
|
36
|
+
|
37
|
+
]
|
38
|
+
});
|
39
|
+
pane.append(); // make sure there is a layer...
|
40
|
+
SC.RunLoop.end();
|
41
|
+
|
42
|
+
view = pane.childViews[0] ;
|
43
|
+
view1 = pane.childViews[1] ;
|
44
|
+
view2 = pane.childViews[2] ;
|
45
|
+
view3 = pane.childViews[3] ;
|
46
|
+
},
|
47
|
+
|
48
|
+
teardown: function() {
|
49
|
+
pane.remove();
|
50
|
+
pane = view = null ;
|
51
|
+
}
|
38
52
|
});
|
39
53
|
|
40
54
|
test("renders a select field input tag with appropriate attributes", function() {
|
41
|
-
|
42
|
-
|
43
|
-
|
55
|
+
equals(view.get('tagName'), 'select', 'should have type as text');
|
56
|
+
var q = Q$('select', view.get('layer'));
|
57
|
+
equals(view.$().attr('id'), SC.guidFor(view), 'should have id as view_guid');
|
44
58
|
});
|
45
59
|
|
46
60
|
test("select component with options", function() {
|
47
|
-
|
48
|
-
|
49
|
-
|
61
|
+
equals(5,view.objects.length,'The select component should have 5 options');
|
62
|
+
equals(null,view.nameKey,'the select should not have any name key');
|
63
|
+
equals(null,view.valueKey,'the select should not have any value key');
|
50
64
|
});
|
51
65
|
|
52
|
-
test("sortObjects() sorts the options of the select component", function() {
|
53
|
-
|
54
|
-
|
66
|
+
test("sortObjects() sorts the options of the select component", function() {
|
67
|
+
var obj = view.objects;
|
68
|
+
view.objects = view.sortObjects(obj);
|
55
69
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
70
|
+
equals(1,obj.get(0),'should be the first element');
|
71
|
+
equals(2,obj.get(1),'should be the second element');
|
72
|
+
equals(6,obj.get(2),'should be the third element');
|
73
|
+
equals(8,obj.get(3),'should be the forth element');
|
74
|
+
equals(11,obj.get(4),'should be the fifth element');
|
61
75
|
});
|
62
76
|
|
63
|
-
test("rebuildMenu() populates the select component with new data", function() {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
77
|
+
test("rebuildMenu() populates the select component with new data", function() {
|
78
|
+
var newObj = ['Hai,','how','are','you?'];
|
79
|
+
view1.objects = newObj;
|
80
|
+
var obj = view1.objects;
|
81
|
+
equals('Hai,',obj.get(0),'should be the first element');
|
82
|
+
equals('how',obj.get(1),'should be the second element');
|
83
|
+
equals('are',obj.get(2),'should be the third element');
|
84
|
+
equals('you?',obj.get(3),'should be the forth element');
|
71
85
|
});
|
72
86
|
|
73
87
|
test("isEnabled=NO should add disabled class", function() {
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
88
|
+
SC.RunLoop.begin();
|
89
|
+
view.set('isEnabled', NO);
|
90
|
+
SC.RunLoop.end();
|
91
|
+
ok(view.$().hasClass('disabled'), 'should have disabled class');
|
92
|
+
});
|
93
|
+
|
94
|
+
test("objects should change on changing the binding", function() {
|
95
|
+
SC.RunLoop.begin();
|
96
|
+
var newObjects = ['Test1','Test2'] ;
|
97
|
+
pane.set('objs', newObjects);
|
98
|
+
SC.RunLoop.end();
|
99
|
+
var objects = view2.objects ;
|
100
|
+
newObjects = pane.objs ;
|
101
|
+
ok(objects===newObjects, 'the objects should be same');
|
78
102
|
});
|
79
103
|
|
80
104
|
|
105
|
+
test("selectedValue shouldn't have st string attached to it", function() {
|
106
|
+
SC.RunLoop.begin();
|
107
|
+
var newObjects = ['Test1','Test2'] ;
|
108
|
+
pane.set('objs', newObjects);
|
109
|
+
SC.RunLoop.end();
|
110
|
+
SC.RunLoop.begin();
|
111
|
+
pane.set('selectedValue', 'Test1');
|
112
|
+
SC.RunLoop.end();
|
113
|
+
var selectedValue = view2.getFieldValue() ;
|
114
|
+
equals(selectedValue,'Test1', 'the new Value is ');
|
115
|
+
|
116
|
+
|
117
|
+
SC.RunLoop.begin();
|
118
|
+
var newObjects2 =[{pos: 1,title:'US/Pacific'},
|
119
|
+
{pos: 2, title:'America/Vancouver'},
|
120
|
+
{pos: 3, title:'Canada/Mountain'},
|
121
|
+
{pos: 4, title:'Other...'}];
|
122
|
+
pane.set('objs', newObjects2);
|
123
|
+
SC.RunLoop.end();
|
124
|
+
SC.RunLoop.begin();
|
125
|
+
pane.set('selectedValue', 'America/Vancouver');
|
126
|
+
SC.RunLoop.end();
|
127
|
+
selectedValue = view3.getFieldValue() ;
|
128
|
+
equals(selectedValue,'America/Vancouver', 'the new Value is ');
|
129
|
+
|
130
|
+
});
|
131
|
+
|
81
132
|
|
@@ -172,9 +172,10 @@ SC.ButtonView = SC.View.extend(SC.Control, SC.Button, SC.StaticLayout,
|
|
172
172
|
|
173
173
|
// If there is a toolTip set, grab it and localize if necessary.
|
174
174
|
var toolTip = this.get('toolTip') ;
|
175
|
-
if(SC.typeOf(toolTip) === SC.T_STRING) {
|
176
|
-
|
177
|
-
|
175
|
+
if (SC.typeOf(toolTip) === SC.T_STRING) {
|
176
|
+
if (this.get('localize')) toolTip = toolTip.loc() ;
|
177
|
+
context.attr('title', toolTip) ;
|
178
|
+
context.attr('alt', toolTip) ;
|
178
179
|
}
|
179
180
|
|
180
181
|
// add some standard attributes & classes.
|
@@ -1959,8 +1959,11 @@ SC.CollectionView = SC.View.extend(
|
|
1959
1959
|
canEdit = (canEdit && itemView.beginEditing) ? itemView.beginEditing() : NO ;
|
1960
1960
|
}
|
1961
1961
|
|
1962
|
-
// if cannot edit,
|
1963
|
-
if (!canEdit)
|
1962
|
+
// if cannot edit, schedule a reselect (but give doubleClick a chance)
|
1963
|
+
if (!canEdit) {
|
1964
|
+
if (this._cv_reselectTimer) this._cv_reselectTimer.invalidate() ;
|
1965
|
+
this._cv_reselectTimer = this.invokeLater(this.select, 300, idx, false) ;
|
1966
|
+
}
|
1964
1967
|
}
|
1965
1968
|
|
1966
1969
|
this._cleanupMouseDown() ;
|
@@ -2710,6 +2713,7 @@ SC.CollectionView = SC.View.extend(
|
|
2710
2713
|
if (delay === undefined) delay = 0 ;
|
2711
2714
|
if (clickCount === undefined) clickCount = 1;
|
2712
2715
|
if ((clickCount>1) || this.get('actOnSelect')) {
|
2716
|
+
if (this._cv_reselectTimer) this._cv_reselectTimer.invalidate() ;
|
2713
2717
|
sel = this.get('selection');
|
2714
2718
|
sel = sel ? sel.toArray() : [];
|
2715
2719
|
if (this._cv_actionTimer) this._cv_actionTimer.invalidate();
|
@@ -370,6 +370,15 @@ SC.ListView = SC.CollectionView.extend(
|
|
370
370
|
}
|
371
371
|
|
372
372
|
end++; // end should be after start
|
373
|
+
|
374
|
+
// if height is greater than 0, on some platforms we should just render
|
375
|
+
// to specific windows in order to minimize render time.
|
376
|
+
if (height > 0 && !SC.browser.msie) {
|
377
|
+
start = start - (start % 50);
|
378
|
+
if (start < 0) start = 0 ;
|
379
|
+
end = end - (end % 50) + 50;
|
380
|
+
}
|
381
|
+
|
373
382
|
if (end<start) end = start;
|
374
383
|
if (end>len) end = len ;
|
375
384
|
|
@@ -400,7 +400,7 @@ SC.ListItemView = SC.View.extend(
|
|
400
400
|
occurred inside of it.
|
401
401
|
*/
|
402
402
|
_isInsideDisclosure: function(evt) {
|
403
|
-
if (this.get('
|
403
|
+
if (this.get('disclosureState')===SC.LEAF_NODE) return NO;
|
404
404
|
return this._isInsideElementWithClassName('disclosure', evt);
|
405
405
|
},
|
406
406
|
|
@@ -574,7 +574,7 @@ SC.ListItemView = SC.View.extend(
|
|
574
574
|
var oldLineHeight = el.css('lineHeight');
|
575
575
|
var fontSize = el.css('fontSize');
|
576
576
|
var top = this.$().css('top');
|
577
|
-
if(top) top = parseInt(top.substring(0,top.length-2),
|
577
|
+
if(top) top = parseInt(top.substring(0,top.length-2),0);
|
578
578
|
else top =0;
|
579
579
|
var lineHeight = oldLineHeight;
|
580
580
|
var lineHeightShift = 0;
|
@@ -204,8 +204,8 @@ SC.MenuItemView = SC.ButtonView.extend( SC.ContentDisplay,
|
|
204
204
|
key = this.getDelegateProperty('isSeparatorKey', del) ;
|
205
205
|
val = (key && content) ? (content.get ? content.get(key) : content[key]) : null ;
|
206
206
|
if (val) {
|
207
|
-
//ic.begin('span').addClass('separator').end() ;
|
208
207
|
ic.push("<span class='separator'></span>") ;
|
208
|
+
context.addClass('disabled') ;
|
209
209
|
} else {
|
210
210
|
// handle checkbox
|
211
211
|
key = this.getDelegateProperty('contentCheckboxKey', del) ;
|
@@ -333,7 +333,7 @@ SC.MenuItemView = SC.ButtonView.extend( SC.ContentDisplay,
|
|
333
333
|
*/
|
334
334
|
getAnchor: function() {
|
335
335
|
var anchor = this.get('anchor') ;
|
336
|
-
if(anchor && anchor.kindOf(SC.MenuItemView)) return anchor ;
|
336
|
+
if(anchor && anchor.kindOf && anchor.kindOf(SC.MenuItemView)) return anchor ;
|
337
337
|
return null ;
|
338
338
|
},
|
339
339
|
|
@@ -437,7 +437,7 @@ SC.MenuItemView = SC.ButtonView.extend( SC.ContentDisplay,
|
|
437
437
|
if (content && content.get(key)) {
|
438
438
|
this.$('.checkbox').setClass('inactive', YES) ;
|
439
439
|
content.set(key, NO) ;
|
440
|
-
} else {
|
440
|
+
} else if( content.get(key)!== undefined ) {
|
441
441
|
this.$('.checkbox').removeClass('inactive') ;
|
442
442
|
content.set(key, YES) ;
|
443
443
|
}
|
@@ -13,6 +13,14 @@ SC.PopupButtonView = SC.ButtonView.extend({
|
|
13
13
|
*/
|
14
14
|
keyEquivalent: null,
|
15
15
|
classNames: ['sc-popup-button'],
|
16
|
+
|
17
|
+
/**
|
18
|
+
Prefer matrix to pass the offsets to position the pane popped up by this
|
19
|
+
button.
|
20
|
+
|
21
|
+
@property
|
22
|
+
*/
|
23
|
+
preferMatrix: null,
|
16
24
|
|
17
25
|
/**private */
|
18
26
|
acceptsFirstResponder: YES,
|
@@ -61,7 +69,7 @@ SC.PopupButtonView = SC.ButtonView.extend({
|
|
61
69
|
var menu = this.get('menu') ;
|
62
70
|
// no menu to toggle... bail...
|
63
71
|
if (!menu) return NO ;
|
64
|
-
menu.popup(this) ;
|
72
|
+
menu.popup(this, this.preferMatrix) ;
|
65
73
|
return YES;
|
66
74
|
}
|
67
75
|
|