Skip to content

Commit 6167b0c

Browse files
committed
MC-31985: [Functional Test Failed]: Functional Tests were failing because of changes to Modal
- reverted #25349 - reverted magento/partners-magento2b2b#49
1 parent 3fd50f2 commit 6167b0c

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

app/code/Magento/Ui/view/base/web/js/modal/modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ define([
308308
* Close modal.
309309
* * @return {Element} - current element.
310310
*/
311-
closeModal: function (event, result) {//eslint-disable-line no-unused-vars
311+
closeModal: function () {
312312
var that = this;
313313

314314
this._removeKeyListener();

app/code/Magento/Ui/view/base/web/js/modal/prompt.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ define([
5151
/**
5252
* Click handler.
5353
*/
54-
click: function (event) {
55-
this.closeModal(event);
54+
click: function () {
55+
this.closeModal();
5656
}
5757
}, {
5858
text: $.mage.__('OK'),
@@ -61,8 +61,8 @@ define([
6161
/**
6262
* Click handler.
6363
*/
64-
click: function (event) {
65-
this.closeModal(event, true);
64+
click: function () {
65+
this.closeModal(true);
6666
}
6767
}]
6868
},
@@ -75,7 +75,7 @@ define([
7575
this.options.validation = this.options.validation && this.options.validationRules.length;
7676
this._super();
7777
this.modal.find(this.options.modalContent).append(this.getFormTemplate());
78-
this.modal.find(this.options.modalCloseBtn).off().on('click', _.bind(this.closeModal, this));
78+
this.modal.find(this.options.modalCloseBtn).off().on('click', _.bind(this.closeModal, this, false));
7979

8080
if (this.options.validation) {
8181
this.setValidationClasses();
@@ -152,23 +152,21 @@ define([
152152
/**
153153
* Close modal window
154154
*/
155-
closeModal: function (event, result) {
155+
closeModal: function (result) {
156156
var value;
157157

158-
result = result || false;
159-
160158
if (result) {
161159
if (this.options.validation && !this.validate()) {
162160
return false;
163161
}
164162

165163
value = this.modal.find(this.options.promptField).val();
166-
this.options.actions.confirm.call(event, value);
164+
this.options.actions.confirm.call(this, value);
167165
} else {
168-
this.options.actions.cancel.call(event, result);
166+
this.options.actions.cancel.call(this, result);
169167
}
170168

171-
this.options.actions.always(event);
169+
this.options.actions.always();
172170
this.element.bind('promptclosed', _.bind(this._remove, this));
173171

174172
return this._super();
@@ -179,4 +177,3 @@ define([
179177
return $('<div class="prompt-message"></div>').html(config.content).prompt(config);
180178
};
181179
});
182-

0 commit comments

Comments
 (0)