sproutcore 1.0.1030 → 1.0.1031
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/VERSION.yml +3 -3
- data/frameworks/sproutcore/frameworks/foundation/system/root_responder.js +1 -1
- data/frameworks/sproutcore/frameworks/foundation/tests/views/text_field/methods.js +44 -33
- data/frameworks/sproutcore/frameworks/foundation/views/text_field.js +1 -1
- data/lib/sproutcore/models/manifest.rb +4 -1
- data/lib/sproutcore/tools.rb +1 -0
- metadata +2 -2
data/VERSION.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
:patch:
|
3
|
-
:digest:
|
2
|
+
:patch: 1031
|
3
|
+
:digest: a4a6ad7402d09a2424b632097d189cbe5249461e
|
4
4
|
:dist:
|
5
|
-
frameworks/sproutcore:
|
5
|
+
frameworks/sproutcore: 8c54dc5a319e402e86319e5a98c21d16744200d8
|
6
6
|
:major: 1
|
7
7
|
:minor: 0
|
@@ -187,7 +187,7 @@ SC.RootResponder = SC.Object.extend({
|
|
187
187
|
// Otherwise, make the main pane the key pane (if it accepts it).
|
188
188
|
if (!newKeyPane) {
|
189
189
|
var mainPane = this.get('mainPane') ;
|
190
|
-
if (mainPane.get('acceptsKeyPane')) newKeyPane = mainPane ;
|
190
|
+
if (mainPane && mainPane.get('acceptsKeyPane')) newKeyPane = mainPane ;
|
191
191
|
}
|
192
192
|
|
193
193
|
// now notify old and new key views of change after edit
|
@@ -11,44 +11,55 @@
|
|
11
11
|
// note: need to test interaction with Validators here
|
12
12
|
// possibly move Validator support to TextFieldView specifically.
|
13
13
|
|
14
|
-
var pane, view, view1;
|
14
|
+
var pane, view, view1, view2;
|
15
|
+
|
15
16
|
module("SC.TextFieldView",{
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
17
|
+
setup: function() {
|
18
|
+
SC.RunLoop.begin();
|
19
|
+
pane = SC.MainPane.create({
|
20
|
+
childViews: [
|
21
|
+
SC.TextFieldView.extend({
|
22
|
+
hint:'First Name',
|
23
|
+
value:'',
|
24
|
+
title:'First Name'
|
25
|
+
}),
|
26
|
+
SC.TextFieldView.extend({
|
27
|
+
hint:'Name',
|
28
|
+
value:'SproutCore',
|
29
|
+
isEnabled: NO
|
30
|
+
}),
|
31
|
+
SC.TextFieldView.extend({
|
32
|
+
layerId: 'fieldWithCustomId'
|
33
|
+
})
|
34
|
+
]
|
35
|
+
});
|
36
|
+
pane.append(); // make sure there is a layer...
|
37
|
+
SC.RunLoop.end();
|
38
|
+
|
39
|
+
view = pane.childViews[0];
|
40
|
+
view1 = pane.childViews[1];
|
41
|
+
view2 = pane.childViews[2];
|
42
|
+
},
|
43
|
+
|
44
|
+
teardown: function() {
|
45
|
+
pane.remove();
|
46
|
+
pane = view = null ;
|
47
|
+
}
|
42
48
|
});
|
43
49
|
|
44
50
|
test("renders an text field input tag with appropriate attributes", function() {
|
45
51
|
equals(view.get('value'), '', 'value should be empty');
|
46
52
|
equals(view1.get('value'), 'SproutCore', 'value should not be empty ');
|
47
|
-
equals(view.get('isEnabled'),YES,'field enabled' );
|
53
|
+
equals(view.get('isEnabled'),YES,'field enabled' );
|
48
54
|
equals(view1.get('isEnabled'),NO,'field not enabled' );
|
49
55
|
var q = Q$('input', view.get('layer'));
|
50
56
|
equals(q.attr('type'), 'text', 'should have type as text');
|
51
|
-
equals(q.attr('name'),
|
57
|
+
equals(q.attr('name'), view.get('layerId'), 'should have name as view_layerid');
|
58
|
+
});
|
59
|
+
|
60
|
+
test("renders an text field with a custom layerId with correct id and name html attributes", function() {
|
61
|
+
equals(view2.$().attr('id'), 'fieldWithCustomId', 'label html element should have the custom id');
|
62
|
+
equals(view2.$input().attr('name'), 'fieldWithCustomId', 'input html element should have the custom name');
|
52
63
|
});
|
53
64
|
|
54
65
|
test("isEnabled=NO should add disabled class", function() {
|
@@ -69,8 +80,8 @@ test("isEnabled=NO should add disabled class", function() {
|
|
69
80
|
|
70
81
|
test("isEnabled and isEditable mapping", function() {
|
71
82
|
var obj= SC.TextFieldView.create();
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
83
|
+
obj.set('isEnabled',false);
|
84
|
+
equals(obj.get('isEditable'),false);
|
85
|
+
obj.set('isEnabled',true);
|
86
|
+
equals(obj.get('isEditable'),true);
|
76
87
|
});
|
@@ -362,7 +362,7 @@ SC.TextFieldView = SC.FieldView.extend(SC.StaticLayout, SC.Editable,
|
|
362
362
|
if (firstTime || this._forceRenderFirstTime) {
|
363
363
|
this._forceRenderFirstTime = NO;
|
364
364
|
var disabled = this.get('isEnabled') ? '' : 'disabled="disabled"' ;
|
365
|
-
var name =
|
365
|
+
var name = this.get('layerId');
|
366
366
|
|
367
367
|
context.push('<span class="border"></span>');
|
368
368
|
|
@@ -277,7 +277,10 @@ module SC
|
|
277
277
|
manifest = self
|
278
278
|
filename = target_name
|
279
279
|
else
|
280
|
-
|
280
|
+
if (_manifest_target = target.target_for(target_name)).nil?
|
281
|
+
throw "Cannot file target #{target_name} for entry #{filename}"
|
282
|
+
end
|
283
|
+
manifest = _manifest_target.manifest_for(self.variation)
|
281
284
|
manifest.build!
|
282
285
|
end
|
283
286
|
|
data/lib/sproutcore/tools.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sproutcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1031
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sprout Systems, Inc. Apple Inc. and contributors
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-16 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|