lib/assets/javascripts/unpoly/form.js.coffee in unpoly-rails-0.23.0 vs lib/assets/javascripts/unpoly/form.js.coffee in unpoly-rails-0.24.0
- old
+ new
@@ -139,20 +139,20 @@
# If a form has file inputs and the browser does not support FormData,
# we cannot offer inline validations.
unless canAjaxSubmit
return u.unresolvablePromise()
- $form.addClass('up-active')
+ up.navigation.markActive($form)
# If we can't submit this form via AJAX or if we wouldn't be able to change
# the location URL as the result, fall back to a vanilla form submission.
unless canAjaxSubmit && canHistoryOption
$form.get(0).submit()
return u.unresolvablePromise()
promise = up.replace(target, url, options)
- promise.always -> $form.removeClass('up-active')
+ promise.always -> up.navigation.unmarkActive($form)
return promise
###*
Observes a field or form and runs a callback when a value changes.
@@ -267,13 +267,10 @@
# and chain additional callback invocations to it.
if u.isPromise(returnValue)
callbackPromise = returnValue
else
callbackPromise = u.resolvedPromise()
- if delay == 0
- runAndChain()
- else
- setTimeout(runAndChain, delay)
+ u.setTimer(delay, runAndChain)
clearTimer = ->
clearTimeout(callbackTimer)
changeEvents = if up.browser.canInputEvent()