Sha256: d573df9579ba1be8b345918174a39758ec91c4e7cb357ca43475fea94fdf7e46
Contents?: true
Size: 963 Bytes
Versions: 44
Compression:
Stored size: 963 Bytes
Contents
jQuery(function() { jQuery('body').on('loadingstart', '.button', function(e) { var button = jQuery(e.target); if (button.hasClass('loading')) { return; } button.addClass('loading'); button.data('disabled-before-loading', button.prop('disabled') ); button.prop('disabled', true); var loader = jQuery('<i />').addClass('loader fa fa-spin fa-spinner'); button.append( loader ); }); jQuery('body').on('loadingend', '.button', function(e) { var button = jQuery(e.target); button.find('.loader').remove(); var disabled_before_loading = button.data('disabled-before-loading') ; if (typeof disabled_before_loading !== 'undefined') { if (!disabled_before_loading) { button.prop('disabled', false); } } button.removeClass('loading'); }); });
Version data entries
44 entries across 44 versions & 1 rubygems