Skip to content

Commit 4e4e456

Browse files
hnrch02cvrebert
authored andcommitted
Fix twbs#12845 - Modal#hide should only be called with an event argument
Closes twbs#12850
1 parent ead17b7 commit 4e4e456

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/js/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
817817
}
818818

819819
Modal.prototype.toggle = function (_relatedTarget) {
820-
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
820+
return this.isShown ? this.hide() : this.show(_relatedTarget)
821821
}
822822

823823
Modal.prototype.show = function (_relatedTarget) {

js/modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737

3838
Modal.prototype.toggle = function (_relatedTarget) {
39-
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
39+
return this.isShown ? this.hide() : this.show(_relatedTarget)
4040
}
4141

4242
Modal.prototype.show = function (_relatedTarget) {

0 commit comments

Comments
 (0)