diff options
author | Mark Otto <otto@github.com> | 2013-02-08 10:18:53 +0400 |
---|---|---|
committer | Mark Otto <otto@github.com> | 2013-02-08 10:18:53 +0400 |
commit | 2aa1a4dc706606e060525907574bb648b773f312 (patch) | |
tree | baccd787bdbcf45a235c3a042c1510730a24b420 /js | |
parent | a9729c5fd003abbfa0d1ab5bc318a069fd5b1382 (diff) | |
parent | 8c7f9c66a7d12f47f50618ef420868fe836d0c33 (diff) |
Merge branch 'master' into 3.0.0-wip
Conflicts:
docs/assets/js/bootstrap.min.js
Diffstat (limited to 'js')
-rw-r--r-- | js/bootstrap-modal.js | 19 | ||||
-rw-r--r-- | js/bootstrap-tooltip.js | 2 | ||||
-rw-r--r-- | js/bootstrap-typeahead.js | 1 | ||||
-rw-r--r-- | js/tests/unit/bootstrap-tooltip.js | 4 |
4 files changed, 14 insertions, 12 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 67c4fade97..23519b3e53 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -138,12 +138,13 @@ }) } - , hideModal: function (that) { - this.$element - .hide() - .trigger('hidden') - - this.backdrop() + , hideModal: function () { + var that = this + this.$element.hide() + this.backdrop(function () { + that.removeBackdrop() + that.$element.trigger('hidden') + }) } , removeBackdrop: function () { @@ -171,6 +172,8 @@ this.$backdrop.addClass('in') + if (!callback) return + doAnimate ? this.$backdrop.one($.support.transition.end, callback) : callback() @@ -179,8 +182,8 @@ this.$backdrop.removeClass('in') $.support.transition && this.$element.hasClass('fade')? - this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) : - this.removeBackdrop() + this.$backdrop.one($.support.transition.end, callback) : + callback() } else if (callback) { callback() diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js index 9218d5d353..12a082f6f4 100644 --- a/js/bootstrap-tooltip.js +++ b/js/bootstrap-tooltip.js @@ -245,7 +245,7 @@ , fixTitle: function () { var $e = this.$element if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { - $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title') + $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') } } diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index 8624bc7bc0..a6bb0a09c2 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -329,7 +329,6 @@ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { var $this = $(this) if ($this.data('typeahead')) return - e.preventDefault() $this.typeahead($this.data()) }) diff --git a/js/tests/unit/bootstrap-tooltip.js b/js/tests/unit/bootstrap-tooltip.js index 97571d243e..5b37b4e687 100644 --- a/js/tests/unit/bootstrap-tooltip.js +++ b/js/tests/unit/bootstrap-tooltip.js @@ -22,9 +22,9 @@ $(function () { ok(!!$.fn.tooltip.defaults, 'defaults is defined') }) - test("should remove title attribute", function () { + test("should empty title attribute", function () { var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>').tooltip() - ok(!tooltip.attr('title'), 'title tag was removed') + ok(tooltip.attr('title') === '', 'title attribute was emptied') }) test("should add data attribute for referencing original title", function () { |