diff --git a/js/modal.js b/js/modal.js index fdefdd2c53..92eff470ad 100644 --- a/js/modal.js +++ b/js/modal.js @@ -166,7 +166,7 @@ this.$backdrop = $('
') .appendTo(this.$body) - this.$element.on('mousedown.dismiss.bs.modal', $.proxy(function (e) { + this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { if (e.target !== e.currentTarget) return this.options.backdrop == 'static' ? this.$element[0].focus.call(this.$element[0]) diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 6c48ed44b4..2262465a4b 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -141,7 +141,7 @@ $(function () { notEqual($('#modal-test').length, 0, 'modal insterted into dom') $('.contents').click() ok($('#modal-test').is(':visible'), 'modal visible') - $('#modal-test').mousedown() + $('#modal-test').click() }) .on('hidden.bs.modal', function () { ok(!$('#modal-test').is(':visible'), 'modal hidden') @@ -196,7 +196,7 @@ $(function () { $('