equal
deleted
inserted
replaced
1 /*! |
1 /*! |
2 * jQuery UI Button 1.13.1 |
2 * jQuery UI Button 1.13.3 |
3 * http://jqueryui.com |
3 * https://jqueryui.com |
4 * |
4 * |
5 * Copyright jQuery Foundation and other contributors |
5 * Copyright OpenJS Foundation and other contributors |
6 * Released under the MIT license. |
6 * Released under the MIT license. |
7 * http://jquery.org/license |
7 * https://jquery.org/license |
8 */ |
8 */ |
9 |
9 |
10 //>>label: Button |
10 //>>label: Button |
11 //>>group: Widgets |
11 //>>group: Widgets |
12 //>>description: Enhances a form with themeable buttons. |
12 //>>description: Enhances a form with themeable buttons. |
13 //>>docs: http://api.jqueryui.com/button/ |
13 //>>docs: https://api.jqueryui.com/button/ |
14 //>>demos: http://jqueryui.com/button/ |
14 //>>demos: https://jqueryui.com/button/ |
15 //>>css.structure: ../../themes/base/core.css |
15 //>>css.structure: ../../themes/base/core.css |
16 //>>css.structure: ../../themes/base/button.css |
16 //>>css.structure: ../../themes/base/button.css |
17 //>>css.theme: ../../themes/base/theme.css |
17 //>>css.theme: ../../themes/base/theme.css |
18 |
18 |
19 ( function( factory ) { |
19 ( function( factory ) { |
28 // These are only for backcompat |
28 // These are only for backcompat |
29 // TODO: Remove after 1.12 |
29 // TODO: Remove after 1.12 |
30 "./controlgroup", |
30 "./controlgroup", |
31 "./checkboxradio", |
31 "./checkboxradio", |
32 |
32 |
33 "./core" |
33 "../keycode", |
|
34 "../widget" |
34 ], factory ); |
35 ], factory ); |
35 } else { |
36 } else { |
36 |
37 |
37 // Browser globals |
38 // Browser globals |
38 factory( jQuery ); |
39 factory( jQuery ); |
39 } |
40 } |
40 } )( function( $ ) { |
41 } )( function( $ ) { |
41 "use strict"; |
42 "use strict"; |
42 |
43 |
43 $.widget( "ui.button", { |
44 $.widget( "ui.button", { |
44 version: "1.13.1", |
45 version: "1.13.3", |
45 defaultElement: "<button>", |
46 defaultElement: "<button>", |
46 options: { |
47 options: { |
47 classes: { |
48 classes: { |
48 "ui-button": "ui-corner-all" |
49 "ui-button": "ui-corner-all" |
49 }, |
50 }, |
238 this._updateIcon( key, value ); |
239 this._updateIcon( key, value ); |
239 } |
240 } |
240 |
241 |
241 // Make sure we can't end up with a button that has neither text nor icon |
242 // Make sure we can't end up with a button that has neither text nor icon |
242 if ( key === "showLabel" ) { |
243 if ( key === "showLabel" ) { |
243 this._toggleClass( "ui-button-icon-only", null, !value ); |
244 this._toggleClass( "ui-button-icon-only", null, !value ); |
244 this._updateTooltip(); |
245 this._updateTooltip(); |
245 } |
246 } |
246 |
247 |
247 if ( key === "label" ) { |
248 if ( key === "label" ) { |
248 if ( this.isInput ) { |
249 if ( this.isInput ) { |
249 this.element.val( value ); |
250 this.element.val( value ); |
304 } |
305 } |
305 if ( !this.options.showLabel && this.options.text ) { |
306 if ( !this.options.showLabel && this.options.text ) { |
306 this.options.text = this.options.showLabel; |
307 this.options.text = this.options.showLabel; |
307 } |
308 } |
308 if ( !this.options.icon && ( this.options.icons.primary || |
309 if ( !this.options.icon && ( this.options.icons.primary || |
309 this.options.icons.secondary ) ) { |
310 this.options.icons.secondary ) ) { |
310 if ( this.options.icons.primary ) { |
311 if ( this.options.icons.primary ) { |
311 this.options.icon = this.options.icons.primary; |
312 this.options.icon = this.options.icons.primary; |
312 } else { |
313 } else { |
313 this.options.icon = this.options.icons.secondary; |
314 this.options.icon = this.options.icons.secondary; |
314 this.options.iconPosition = "end"; |
315 this.options.iconPosition = "end"; |