use-price-default-handler.js 699 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. define([
  6. 'Magento_Ui/js/form/element/single-checkbox'
  7. ], function (Element) {
  8. 'use strict';
  9. return Element.extend({
  10. defaults: {
  11. linksPurchasedSeparately: '0',
  12. listens: {
  13. linksPurchasedSeparately: 'changeVisibleStatus'
  14. }
  15. },
  16. /**
  17. * Change visibility of checkbox
  18. */
  19. changeVisibleStatus: function () {
  20. if (this.linksPurchasedSeparately === '1') {
  21. this.visible(true);
  22. } else {
  23. this.visible(false);
  24. }
  25. }
  26. });
  27. });