diff options
author | Mark Otto <otto@github.com> | 2013-03-02 00:37:21 +0400 |
---|---|---|
committer | Mark Otto <otto@github.com> | 2013-03-02 00:37:21 +0400 |
commit | a70c50d1f70ffa1582a2bdba7a9a0ce6c40fd60b (patch) | |
tree | 9469244a7e9b607e360e860149b5211367d25be9 /js | |
parent | 77e8e2aee9d560b9152ddb8f214da2aa6e03d516 (diff) | |
parent | eb24718add4dd36fe92fdbdb79e6ff4ce5919300 (diff) |
Merge branch 'master' into 3.0.0-wip
Conflicts:
Makefile
README.md
component.json
docs/assets/css/bootstrap-responsive.css
docs/assets/css/bootstrap.css
docs/assets/js/bootstrap-affix.js
docs/assets/js/bootstrap-alert.js
docs/assets/js/bootstrap-button.js
docs/assets/js/bootstrap-carousel.js
docs/assets/js/bootstrap-collapse.js
docs/assets/js/bootstrap-dropdown.js
docs/assets/js/bootstrap-modal.js
docs/assets/js/bootstrap-popover.js
docs/assets/js/bootstrap-scrollspy.js
docs/assets/js/bootstrap-tab.js
docs/assets/js/bootstrap-tooltip.js
docs/assets/js/bootstrap-transition.js
docs/assets/js/bootstrap-typeahead.js
docs/assets/js/bootstrap.js
docs/assets/js/bootstrap.min.js
docs/index.html
docs/templates/pages/index.mustache
js/bootstrap-affix.js
js/bootstrap-alert.js
js/bootstrap-button.js
js/bootstrap-carousel.js
js/bootstrap-collapse.js
js/bootstrap-dropdown.js
js/bootstrap-modal.js
js/bootstrap-popover.js
js/bootstrap-scrollspy.js
js/bootstrap-tab.js
js/bootstrap-tooltip.js
js/bootstrap-transition.js
js/bootstrap-typeahead.js
less/bootstrap.less
less/responsive.less
package.json
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 83cdffd0e8..3a9d980c4e 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 605757825c..0b1663f48f 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 23519b3e53..34249a4063 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 12a082f6f4..03a65e7e1d 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 98aa990a67..b0096f8ed3 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 |