Skip to content

Commit

Permalink
MC-31985: [Functional Test Failed]: Functional Tests were failing bec…
Browse files Browse the repository at this point in the history
…ause of changes to Modal

- reverted #25349
- reverted magento/partners-magento2b2b#49
  • Loading branch information
slavvka committed Feb 27, 2020
1 parent 3fd50f2 commit 6167b0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Ui/view/base/web/js/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ define([
* Close modal.
* * @return {Element} - current element.
*/
closeModal: function (event, result) {//eslint-disable-line no-unused-vars
closeModal: function () {
var that = this;

this._removeKeyListener();
Expand Down
21 changes: 9 additions & 12 deletions app/code/Magento/Ui/view/base/web/js/modal/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ define([
/**
* Click handler.
*/
click: function (event) {
this.closeModal(event);
click: function () {
this.closeModal();
}
}, {
text: $.mage.__('OK'),
Expand All @@ -61,8 +61,8 @@ define([
/**
* Click handler.
*/
click: function (event) {
this.closeModal(event, true);
click: function () {
this.closeModal(true);
}
}]
},
Expand All @@ -75,7 +75,7 @@ define([
this.options.validation = this.options.validation && this.options.validationRules.length;
this._super();
this.modal.find(this.options.modalContent).append(this.getFormTemplate());
this.modal.find(this.options.modalCloseBtn).off().on('click', _.bind(this.closeModal, this));
this.modal.find(this.options.modalCloseBtn).off().on('click', _.bind(this.closeModal, this, false));

if (this.options.validation) {
this.setValidationClasses();
Expand Down Expand Up @@ -152,23 +152,21 @@ define([
/**
* Close modal window
*/
closeModal: function (event, result) {
closeModal: function (result) {
var value;

result = result || false;

if (result) {
if (this.options.validation && !this.validate()) {
return false;
}

value = this.modal.find(this.options.promptField).val();
this.options.actions.confirm.call(event, value);
this.options.actions.confirm.call(this, value);
} else {
this.options.actions.cancel.call(event, result);
this.options.actions.cancel.call(this, result);
}

this.options.actions.always(event);
this.options.actions.always();
this.element.bind('promptclosed', _.bind(this._remove, this));

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

0 comments on commit 6167b0c

Please sign in to comment.