2014-06-08 23:30:42 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* See the following change record for more information,
|
2017-05-23 14:30:14 +00:00
|
|
|
* https://www.drupal.org/node/2815083
|
2017-05-19 22:12:53 +00:00
|
|
|
* @preserve
|
|
|
|
**/
|
2015-06-08 14:04:39 +00:00
|
|
|
|
2014-06-08 23:30:42 +00:00
|
|
|
(function ($) {
|
|
|
|
$.widget('ui.dialog', $.ui.dialog, {
|
|
|
|
options: {
|
|
|
|
buttonClass: 'button',
|
|
|
|
buttonPrimaryClass: 'button--primary'
|
|
|
|
},
|
2017-05-19 22:12:53 +00:00
|
|
|
_createButtons: function _createButtons() {
|
2014-06-08 23:30:42 +00:00
|
|
|
var opts = this.options;
|
2020-01-30 09:08:38 +00:00
|
|
|
var primaryIndex;
|
|
|
|
var index;
|
2015-04-19 15:30:43 +00:00
|
|
|
var il = opts.buttons.length;
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2015-04-19 15:30:43 +00:00
|
|
|
for (index = 0; index < il; index++) {
|
2014-06-08 23:30:42 +00:00
|
|
|
if (opts.buttons[index].primary && opts.buttons[index].primary === true) {
|
|
|
|
primaryIndex = index;
|
|
|
|
delete opts.buttons[index].primary;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2014-06-08 23:30:42 +00:00
|
|
|
this._super();
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2017-10-12 10:13:43 +00:00
|
|
|
var $buttons = this.uiButtonSet.children().addClass(opts.buttonClass);
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2014-06-08 23:30:42 +00:00
|
|
|
if (typeof primaryIndex !== 'undefined') {
|
|
|
|
$buttons.eq(index).addClass(opts.buttonPrimaryClass);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2017-05-19 22:12:53 +00:00
|
|
|
})(jQuery);
|