Sha256: 363ee0a50379f28629e3dd3bff5ca069f33fe63330ca2add73c1b92be5fbed00
Contents?: true
Size: 731 Bytes
Versions: 23
Compression:
Stored size: 731 Bytes
Contents
mumuki.Button = class { constructor($button, $container) { this.$button = $button; this.$container = $container || $button; this.originalContent = $button.html(); } disable () { this.$container.attr('disabled', 'disabled'); } setWaiting () { this.preventClick(); this.setWaitingText(); } enable () { this.setOriginalContent(); this.$container.removeAttr('disabled'); } setWaitingText () { this.$button.html('<i class="fa fa-refresh fa-spin"></i> ' + this.$button.attr('data-waiting')); } setOriginalContent () { this.$button.html(this.originalContent); } preventClick () { this.disable(); this.$button.on('click', (e) => e.preventDefault()); } };
Version data entries
23 entries across 23 versions & 1 rubygems