Reduce the amount of JavaScript written in views

Seeing `:javascript` all over Views feels like a code smell. This goes a
long way towards reducing the amount of JS in views, but there's still
plenty to be done on that front.
This commit is contained in:
Robert Speicher 2012-09-10 02:09:55 -04:00
parent b565f33472
commit d6c384c20f
18 changed files with 22 additions and 122 deletions

View file

@ -24,6 +24,9 @@ $ ->
# Click a .one_click_select field, select the contents
$(".one_click_select").live 'click', -> $(this).select()
# Initialize chosen selects
$('select.chosen').chosen()
# Disable form buttons while a form is submitting
$('body').on 'ajax:complete, ajax:beforeSend, submit', 'form', (e) ->
buttons = $('[type="submit"]', this)