Skip to content

Commit

Permalink
MDL-77964 availability: avoid JS console errors when closing modal.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulholden committed Jun 25, 2024
1 parent ad7fc69 commit 33267a4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ M.core_availability.List.prototype.clickAdd = function() {
dialogRef.dialog = new M.core.dialogue(config);
dialogRef.dialog.show();
cancel.on('click', function() {
dialogRef.dialog.destroy();
dialogRef.dialog.hide();
// Focus the button they clicked originally.
this.inner.one('> .availability-button').one('button').focus();
}, this);
Expand Down Expand Up @@ -792,7 +792,7 @@ M.core_availability.List.prototype.getAddHandler = function(type, dialogRef) {
M.core_availability.form.rootList.renumber();
this.updateHtml();
// Hide dialog.
dialogRef.dialog.destroy();
dialogRef.dialog.hide();
newItem.focusAfterAdd();
};
};
Expand Down
Loading

0 comments on commit 33267a4

Please sign in to comment.