annotate core/misc/dialog/dialog.jquery-ui.js @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 1fec387a4317
children
rev   line source
Chris@0 1 /**
Chris@0 2 * DO NOT EDIT THIS FILE.
Chris@0 3 * See the following change record for more information,
Chris@0 4 * https://www.drupal.org/node/2815083
Chris@0 5 * @preserve
Chris@0 6 **/
Chris@0 7
Chris@0 8 (function ($) {
Chris@0 9 $.widget('ui.dialog', $.ui.dialog, {
Chris@0 10 options: {
Chris@0 11 buttonClass: 'button',
Chris@0 12 buttonPrimaryClass: 'button--primary'
Chris@0 13 },
Chris@0 14 _createButtons: function _createButtons() {
Chris@0 15 var opts = this.options;
Chris@0 16 var primaryIndex = void 0;
Chris@0 17 var index = void 0;
Chris@0 18 var il = opts.buttons.length;
Chris@0 19 for (index = 0; index < il; index++) {
Chris@0 20 if (opts.buttons[index].primary && opts.buttons[index].primary === true) {
Chris@0 21 primaryIndex = index;
Chris@0 22 delete opts.buttons[index].primary;
Chris@0 23 break;
Chris@0 24 }
Chris@0 25 }
Chris@0 26 this._super();
Chris@14 27 var $buttons = this.uiButtonSet.children().addClass(opts.buttonClass);
Chris@0 28 if (typeof primaryIndex !== 'undefined') {
Chris@0 29 $buttons.eq(index).addClass(opts.buttonPrimaryClass);
Chris@0 30 }
Chris@0 31 }
Chris@0 32 });
Chris@0 33 })(jQuery);