MCPcopy Create free account
hub / github.com/dcloudio/mui / Button

Function Button

js/mui.button.js:21–36  ·  view source on GitHub ↗
(element, options)

Source from the content-addressed store, hash-verified

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 };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected