1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-17 19:06:40 +02:00

Merge branch 'master' into 3.0.0-wip

Conflicts:
	docs/assets/js/bootstrap.min.js
This commit is contained in:
Mark Otto
2013-02-07 22:18:53 -08:00
12 changed files with 71 additions and 33 deletions

19
js/bootstrap-modal.js vendored
View File

@@ -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()

View File

@@ -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', '')
}
}

View File

@@ -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())
})

View File

@@ -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 () {