confirm.js 741 B

123456789101112131415161718192021222324252627282930
  1. /**
  2. * Copyright © Magento, Inc. All rights reserved.
  3. * See COPYING.txt for license details.
  4. */
  5. define(['underscore'], function (_) {
  6. 'use strict';
  7. return function (solution, message, argument) {
  8. var isConfirm = false;
  9. _.every(argument, function (name) {
  10. if (solution.solutionsElements[name] &&
  11. solution.solutionsElements[name].find(solution.enableButton).val() == 1 //eslint-disable-line eqeqeq
  12. ) {
  13. isConfirm = true;
  14. return !isConfirm;
  15. }
  16. return !isConfirm;
  17. }, this);
  18. if (isConfirm) {
  19. return confirm(message); //eslint-disable-line no-alert
  20. }
  21. return true;
  22. };
  23. });