Show More
Commit Description:
change announcement toggle into bootstrap button with processing state
Commit Description:
change announcement toggle into bootstrap button with processing state
File last commit:
Show/Diff file:
Action:
app/assets/javascripts/announcements.js.coffee | 15 lines | 442 B | text/coffeescript | CoffeeScriptLexer |
#js for announcement
$ ->
$('.ajax-toggle').on 'click', (event) ->
console.log event.target.id
target = $(event.target)
target.removeClass 'btn-default'
target.removeClass 'btn-success'
target.addClass 'btn-warning'
target.text '...'
return
$(document).ajaxError (event, jqxhr, settings, exception) ->
if jqxhr.status
alert 'We\'re sorry, but something went wrong (' + jqxhr.status + ')'
return