Skip to content

Commit d1e49b1

Browse files
committed
MAGETWO-36916: Impossible to delete any entity which calls confirmation alert
- Added deleteConfirm method in global scope.
1 parent e98a487 commit d1e49b1

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lib/web/mage/adminhtml/globals.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
* Copyright © 2015 Magento. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
5-
define([
6-
], function () {
5+
define([], function () {
76
'use strict';
87

98
/**
@@ -13,4 +12,18 @@ define([
1312
window.setLocation = function (url) {
1413
window.location.href = url;
1514
};
15+
16+
/**
17+
* Helper for onclick action.
18+
* @param {String} message
19+
* @param {String} url
20+
* @returns {boolean}
21+
*/
22+
window.deleteConfirm = function (message, url) {
23+
if (confirm(message)) {
24+
setLocation(url);
25+
}
26+
27+
return false;
28+
};
1629
});

0 commit comments

Comments
 (0)