Skip to content

Commit

Permalink
Refactor from a function to a function expression to avoid block scop…
Browse files Browse the repository at this point in the history
…ing (#160)
  • Loading branch information
ChadKillingsworth authored and samthor committed Feb 4, 2018
1 parent bdc12f9 commit 32434f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dialog-polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,13 +689,13 @@
* submit event and give us a chance to respond.
*/
var nativeFormSubmit = HTMLFormElement.prototype.submit;
function replacementFormSubmit() {
var replacementFormSubmit = function () {
if (!isFormMethodDialog(this)) {
return nativeFormSubmit.call(this);
}
var dialog = findNearestDialog(this);
dialog && dialog.close();
}
};
HTMLFormElement.prototype.submit = replacementFormSubmit;

/**
Expand Down

0 comments on commit 32434f9

Please sign in to comment.