packages.js 922 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. define([
  6. 'jquery',
  7. 'Magento_Ui/js/modal/modal',
  8. 'mage/translate'
  9. ], function ($, modal, $t) {
  10. 'use strict';
  11. return function (config, element) {
  12. config.buttons = [
  13. {
  14. text: $t('Print'),
  15. 'class': 'action action-primary',
  16. /**
  17. * Click handler
  18. */
  19. click: function () {
  20. window.location.href = this.options.url;
  21. }
  22. }, {
  23. text: $t('Cancel'),
  24. 'class': 'action action-secondary',
  25. /**
  26. * Click handler
  27. */
  28. click: function () {
  29. this.closeModal();
  30. }
  31. }
  32. ];
  33. modal(config, element);
  34. };
  35. });