diff options
| author | Mark Otto <[email protected]> | 2013-03-01 13:53:21 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2013-03-01 13:53:21 -0800 |
| commit | 1f160d4c12e2801d5ede245099d74386f91214a8 (patch) | |
| tree | 5984bee820ad1f6eec6db7de511f1ad46fb51a45 /js | |
| parent | f59e4fdba32b99bdd4e6387f889dda4c9270f762 (diff) | |
| parent | e0647e8273aee5bd09d5461f6f974e36b3d0c3c9 (diff) | |
| download | bootstrap-1f160d4c12e2801d5ede245099d74386f91214a8.tar.xz bootstrap-1f160d4c12e2801d5ede245099d74386f91214a8.zip | |
Merge branch '3.0.0-wip' into bs3_makefile_separated_done
Conflicts:
Makefile
Diffstat (limited to 'js')
| -rw-r--r-- | js/bootstrap-carousel.js | 2 | ||||
| -rw-r--r-- | js/bootstrap-dropdown.js | 2 | ||||
| -rw-r--r-- | js/bootstrap-modal.js | 2 | ||||
| -rw-r--r-- | js/bootstrap-tooltip.js | 10 | ||||
| -rw-r--r-- | js/tests/unit/bootstrap-modal.js | 17 |
5 files changed, 29 insertions, 4 deletions
diff --git a/js/bootstrap-carousel.js b/js/bootstrap-carousel.js index 83cdffd0e..3a9d980c4 100644 --- a/js/bootstrap-carousel.js +++ b/js/bootstrap-carousel.js @@ -75,7 +75,7 @@ if (!e) this.paused = true if (this.$element.find('.next, .prev').length && $.support.transition.end) { this.$element.trigger($.support.transition.end) - this.cycle() + this.cycle(true) } clearInterval(this.interval) this.interval = null diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js index 605757825..0b1663f48 100644 --- a/js/bootstrap-dropdown.js +++ b/js/bootstrap-dropdown.js @@ -158,7 +158,7 @@ $(document) .on('click.dropdown.data-api', clearMenus) .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) - .on('.dropdown-menu', function (e) { e.stopPropagation() }) + .on('click.dropdown-menu', function (e) { e.stopPropagation() }) .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 23519b3e5..34249a406 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -148,7 +148,7 @@ } , removeBackdrop: function () { - this.$backdrop.remove() + this.$backdrop && this.$backdrop.remove() this.$backdrop = null } diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index 12a082f6f..03a65e7e1 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -80,7 +80,15 @@ } , enter: function (e) { - var self = $(e.currentTarget)[this.type](this._options).data(this.type) + var defaults = $.fn[this.type].defaults + , options = {} + , self + + this._options && $.each(this._options, function (key, value) { + if (defaults[key] != value) options[key] = value + }, this) + + self = $(e.currentTarget)[this.type](options).data(this.type) if (!self.options.delay || !self.options.delay.show) return self.show() diff --git a/js/tests/unit/bootstrap-modal.js b/js/tests/unit/bootstrap-modal.js index 98aa990a6..b0096f8ed 100644 --- a/js/tests/unit/bootstrap-modal.js +++ b/js/tests/unit/bootstrap-modal.js @@ -117,4 +117,21 @@ $(function () { }) .modal("toggle") }) + + test("should allow modal close with 'backdrop:false'", function () { + stop() + $.support.transition = false + var div = $("<div>", { id: 'modal-test', "data-backdrop": false }) + div + .bind("shown", function () { + ok($('#modal-test').is(":visible"), 'modal visible') + div.modal("hide") + }) + .bind("hidden", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') + div.remove() + start() + }) + .modal("show") + }) })
\ No newline at end of file |
