sidebar.js 684 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. define([], function () {
  6. 'use strict';
  7. return {
  8. popUp: false,
  9. /**
  10. * @param {Object} popUp
  11. */
  12. setPopup: function (popUp) {
  13. this.popUp = popUp;
  14. },
  15. /**
  16. * Show popup.
  17. */
  18. show: function () {
  19. if (this.popUp) {
  20. this.popUp.modal('openModal');
  21. }
  22. },
  23. /**
  24. * Hide popup.
  25. */
  26. hide: function () {
  27. if (this.popUp) {
  28. this.popUp.modal('closeModal');
  29. }
  30. }
  31. };
  32. });