mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-11 08:54:23 +01:00
Merge branch '2.0.3-wip' of github.com:twitter/bootstrap into 2.0.3-wip
Conflicts: docs/assets/bootstrap.zip
This commit is contained in:
commit
6c221d65e3
2
Makefile
2
Makefile
@ -36,7 +36,7 @@ bootstrap:
|
|||||||
jshint js/tests/unit/*.js --config js/.jshintrc
|
jshint js/tests/unit/*.js --config js/.jshintrc
|
||||||
cat js/bootstrap-transition.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-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js
|
cat js/bootstrap-transition.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-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js
|
||||||
uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
|
uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
|
||||||
echo "/**\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
|
echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
|
||||||
cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
|
cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
|
||||||
rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
|
rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
|
||||||
|
|
||||||
|
Binary file not shown.
7
docs/assets/js/bootstrap-scrollspy.js
vendored
7
docs/assets/js/bootstrap-scrollspy.js
vendored
@ -94,12 +94,11 @@
|
|||||||
|
|
||||||
this.activeTarget = target
|
this.activeTarget = target
|
||||||
|
|
||||||
this.$body
|
$(this.selector)
|
||||||
.find(this.selector).parent('.active')
|
.parent('.active')
|
||||||
.removeClass('active')
|
.removeClass('active')
|
||||||
|
|
||||||
active = this.$body
|
active = $(this.selector + '[href="' + target + '"]')
|
||||||
.find(this.selector + '[href="' + target + '"]')
|
|
||||||
.parent('li')
|
.parent('li')
|
||||||
.addClass('active')
|
.addClass('active')
|
||||||
|
|
||||||
|
20
docs/assets/js/bootstrap-tooltip.js
vendored
20
docs/assets/js/bootstrap-tooltip.js
vendored
@ -72,34 +72,26 @@
|
|||||||
, enter: function (e) {
|
, enter: function (e) {
|
||||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.show) {
|
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||||
self.show()
|
|
||||||
} else {
|
|
||||||
clearTimeout(this.timeout)
|
clearTimeout(this.timeout)
|
||||||
self.hoverState = 'in'
|
self.hoverState = 'in'
|
||||||
this.timeout = setTimeout(function() {
|
this.timeout = setTimeout(function() {
|
||||||
if (self.hoverState == 'in') {
|
if (self.hoverState == 'in') self.show()
|
||||||
self.show()
|
|
||||||
}
|
|
||||||
}, self.options.delay.show)
|
}, self.options.delay.show)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
, leave: function (e) {
|
, leave: function (e) {
|
||||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.hide) {
|
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||||
self.hide()
|
|
||||||
} else {
|
|
||||||
clearTimeout(this.timeout)
|
clearTimeout(this.timeout)
|
||||||
self.hoverState = 'out'
|
self.hoverState = 'out'
|
||||||
this.timeout = setTimeout(function() {
|
this.timeout = setTimeout(function() {
|
||||||
if (self.hoverState == 'out') {
|
if (self.hoverState == 'out') self.hide()
|
||||||
self.hide()
|
|
||||||
}
|
|
||||||
}, self.options.delay.hide)
|
}, self.options.delay.hide)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
, show: function () {
|
, show: function () {
|
||||||
var $tip
|
var $tip
|
||||||
|
7
js/bootstrap-scrollspy.js
vendored
7
js/bootstrap-scrollspy.js
vendored
@ -94,12 +94,11 @@
|
|||||||
|
|
||||||
this.activeTarget = target
|
this.activeTarget = target
|
||||||
|
|
||||||
this.$body
|
$(this.selector)
|
||||||
.find(this.selector).parent('.active')
|
.parent('.active')
|
||||||
.removeClass('active')
|
.removeClass('active')
|
||||||
|
|
||||||
active = this.$body
|
active = $(this.selector + '[href="' + target + '"]')
|
||||||
.find(this.selector + '[href="' + target + '"]')
|
|
||||||
.parent('li')
|
.parent('li')
|
||||||
.addClass('active')
|
.addClass('active')
|
||||||
|
|
||||||
|
20
js/bootstrap-tooltip.js
vendored
20
js/bootstrap-tooltip.js
vendored
@ -72,34 +72,26 @@
|
|||||||
, enter: function (e) {
|
, enter: function (e) {
|
||||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.show) {
|
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||||
self.show()
|
|
||||||
} else {
|
|
||||||
clearTimeout(this.timeout)
|
clearTimeout(this.timeout)
|
||||||
self.hoverState = 'in'
|
self.hoverState = 'in'
|
||||||
this.timeout = setTimeout(function() {
|
this.timeout = setTimeout(function() {
|
||||||
if (self.hoverState == 'in') {
|
if (self.hoverState == 'in') self.show()
|
||||||
self.show()
|
|
||||||
}
|
|
||||||
}, self.options.delay.show)
|
}, self.options.delay.show)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
, leave: function (e) {
|
, leave: function (e) {
|
||||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||||
|
|
||||||
if (!self.options.delay || !self.options.delay.hide) {
|
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||||
self.hide()
|
|
||||||
} else {
|
|
||||||
clearTimeout(this.timeout)
|
clearTimeout(this.timeout)
|
||||||
self.hoverState = 'out'
|
self.hoverState = 'out'
|
||||||
this.timeout = setTimeout(function() {
|
this.timeout = setTimeout(function() {
|
||||||
if (self.hoverState == 'out') {
|
if (self.hoverState == 'out') self.hide()
|
||||||
self.hide()
|
|
||||||
}
|
|
||||||
}, self.options.delay.hide)
|
}, self.options.delay.hide)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
, show: function () {
|
, show: function () {
|
||||||
var $tip
|
var $tip
|
||||||
|
50
js/tests/unit/bootstrap-tooltip.js
vendored
50
js/tests/unit/bootstrap-tooltip.js
vendored
@ -59,6 +59,56 @@ $(function () {
|
|||||||
ok(!$(".tooltip").length, 'tooltip removed')
|
ok(!$(".tooltip").length, 'tooltip removed')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("should not show tooltip if leave event occurs before delay expires", function () {
|
||||||
|
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
||||||
|
.appendTo('#qunit-fixture')
|
||||||
|
.tooltip({ delay: 200 })
|
||||||
|
|
||||||
|
stop()
|
||||||
|
|
||||||
|
tooltip.trigger('mouseenter')
|
||||||
|
|
||||||
|
setTimeout(function () {
|
||||||
|
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
|
||||||
|
tooltip.trigger('mouseout')
|
||||||
|
setTimeout(function () {
|
||||||
|
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
|
||||||
|
start()
|
||||||
|
}, 200)
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
|
||||||
|
test("should not show tooltip if leave event occurs before delay expires", function () {
|
||||||
|
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
||||||
|
.appendTo('#qunit-fixture')
|
||||||
|
.tooltip({ delay: 100 })
|
||||||
|
stop()
|
||||||
|
tooltip.trigger('mouseenter')
|
||||||
|
setTimeout(function () {
|
||||||
|
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
|
||||||
|
tooltip.trigger('mouseout')
|
||||||
|
setTimeout(function () {
|
||||||
|
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
|
||||||
|
start()
|
||||||
|
}, 100)
|
||||||
|
}, 50)
|
||||||
|
})
|
||||||
|
|
||||||
|
test("should show tooltip if leave event hasn't occured before delay expires", function () {
|
||||||
|
var tooltip = $('<a href="#" rel="tooltip" title="Another tooltip"></a>')
|
||||||
|
.appendTo('#qunit-fixture')
|
||||||
|
.tooltip({ delay: 200 })
|
||||||
|
stop()
|
||||||
|
tooltip.trigger('mouseenter')
|
||||||
|
setTimeout(function () {
|
||||||
|
ok(!$(".tooltip").hasClass('fade in'), 'tooltip is not faded in')
|
||||||
|
setTimeout(function () {
|
||||||
|
ok(!$(".tooltip").hasClass('fade in'), 'tooltip has faded in')
|
||||||
|
start()
|
||||||
|
}, 200)
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
|
||||||
test("should detect if title string is html or text: foo", function () {
|
test("should detect if title string is html or text: foo", function () {
|
||||||
ok(!$.fn.tooltip.Constructor.prototype.isHTML('foo'), 'correctly detected html')
|
ok(!$.fn.tooltip.Constructor.prototype.isHTML('foo'), 'correctly detected html')
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user