dialog.jquery-ui.js 970 B

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