lib/assets/javascripts/tao/ui/shared/ujs.coffee in tao_ui-0.2.2 vs lib/assets/javascripts/tao/ui/shared/ujs.coffee in tao_ui-0.2.3
- old
+ new
@@ -1,9 +1,11 @@
# hack ujs for adding loading icon on disabled buttons/links
prependLoadingIcon = (element) ->
- $(element).addClass('text-with-icon')
- .prepend Tao.iconTag('loading', class: 'spin')
+ $element = $ element
+ if $element.is('button') && $element.data('loading')
+ $element.addClass('text-with-icon')
+ .prepend Tao.iconTag('loading', class: 'spin')
# jquery-ujs
if $.rails?
originDisableElement = $.rails.disableElement
$.rails.disableElement = (element) ->