(element, options)
| 19 | }; |
| 20 | |
| 21 | var Button = function(element, options) { |
| 22 | this.element = element; |
| 23 | this.options = $.extend({}, defaultOptions, options); |
| 24 | if (!this.options.loadingText) { |
| 25 | this.options.loadingText = defaultOptions.loadingText; |
| 26 | } |
| 27 | if (this.options.loadingIcon === null) { |
| 28 | this.options.loadingIcon = $.className('spinner'); |
| 29 | if ($.getStyles(this.element, 'color') === 'rgb(255, 255, 255)') { |
| 30 | this.options.loadingIcon += ' ' + $.className('spinner-white'); |
| 31 | } |
| 32 | } |
| 33 | this.isInput = this.element.tagName === 'INPUT'; |
| 34 | this.resetHTML = this.isInput ? this.element.value : this.element.innerHTML; |
| 35 | this.state = ''; |
| 36 | }; |
| 37 | Button.prototype.loading = function() { |
| 38 | this.setState(STATE_LOADING); |
| 39 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected