Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
790f145e
authored
2013-04-07 16:56:58 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use jQuery's .val() in getInputValue if window.jQuery is present. [#133]
1 parent
169311ac
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
src/rivets.coffee
src/rivets.coffee
View file @
790f145
...
...
@@ -251,8 +251,15 @@ unbindEvent = (el, event, fn) ->
event
=
'on'
+
event
el
.
detachEvent
event
,
fn
#
Returns the current input value for the specified element
.
#
Cross-browser input value getter
.
getInputValue
=
(
el
)
->
if
window
.
jQuery
?
el
=
jQuery
el
switch
el
[
0
].
type
when
'checkbox'
then
el
.
is
':checked'
else
el
.
val
()
else
switch
el
.
type
when
'checkbox'
then
el
.
checked
when
'select-multiple'
then
o
.
value
for
o
in
el
when
o
.
selected
...
...
Please
register
or
sign in
to post a comment