grand_central 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grand_central/action.rb +24 -20
- data/lib/grand_central/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a3a3cc73a89f4c695d4e4c5277fb4cc428c808e
|
4
|
+
data.tar.gz: db1292b19b6f2838d4bb24ce16d1d11907bdf1a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91d3814a9f5a5ec8c63a18ebddedb37c9e8bdc046aa7dc4724c13e9feae2bccae528a3a987a4748a5a00c83dd80db3cb5246f0a1bb98871439bf625416865eb5
|
7
|
+
data.tar.gz: 22e7f863963c560cdcaaf7ae50c0fdc6beb8e14d582f1eafe761b9f0c929ec3c8cdc0d91c1260263886afd9472858fb0e622ff3e1358bd6336e2a0a562a02fc3
|
data/lib/grand_central/action.rb
CHANGED
@@ -89,30 +89,34 @@ module GrandCentral
|
|
89
89
|
return args
|
90
90
|
end
|
91
91
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
92
|
+
args.map do |arg|
|
93
|
+
if arg.class.name == 'Bowser::Event'
|
94
|
+
event = arg
|
95
|
+
|
96
|
+
case event.type
|
97
|
+
when 'submit'
|
98
|
+
# We're modifying a value we received, which is usually a no-no, but
|
99
|
+
# in this case it's the most pragmatic solution I can think of.
|
100
|
+
event.prevent
|
101
|
+
event
|
102
|
+
when 'input'
|
103
|
+
event.target.value
|
104
|
+
when 'change'
|
105
|
+
element = event.target
|
106
|
+
|
107
|
+
# In hindsight, using Element#type for the tag type was a bad idea.
|
108
|
+
# It means we need to dip into JS to get the damn type property.
|
109
|
+
if element.type == 'input' && `#{element.to_n}.type` == 'checkbox'
|
110
|
+
element.checked?
|
111
|
+
else
|
112
|
+
element.value
|
113
|
+
end
|
108
114
|
else
|
109
|
-
|
115
|
+
arg
|
110
116
|
end
|
111
117
|
else
|
112
|
-
|
118
|
+
arg
|
113
119
|
end
|
114
|
-
else
|
115
|
-
args
|
116
120
|
end
|
117
121
|
end
|
118
122
|
end
|