dialog.jquery-ui.js 945 B

123456789101112131415161718192021222324252627282930313233
  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 index = void 0;
  17. var il = opts.buttons.length;
  18. for (index = 0; index < il; index++) {
  19. if (opts.buttons[index].primary && opts.buttons[index].primary === true) {
  20. primaryIndex = index;
  21. delete opts.buttons[index].primary;
  22. break;
  23. }
  24. }
  25. this._super();
  26. var $buttons = this.uiButtonSet.children().addClass(opts.buttonClass);
  27. if (typeof primaryIndex !== 'undefined') {
  28. $buttons.eq(index).addClass(opts.buttonPrimaryClass);
  29. }
  30. }
  31. });
  32. })(jQuery);