}
}
- Tooltip.prototype.applyPlacement = function(offset, placement) {
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
var replace
var $tip = this.tip()
var width = $tip[0].offsetWidth
if (replace) $tip.offset(offset)
}
- Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
+ Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
}
ok($('#modal-test').length, 'modal inserted into dom')
$(this).modal("hide")
})
- .on("hidden.bs.modal", function() {
+ .on("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
$('#modal-test').remove()
start()
ok($('#modal-test').length, 'modal inserted into dom')
div.modal("toggle")
})
- .on("hidden.bs.modal", function() {
+ .on("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
ok($('#modal-test').length, 'modal inserted into dom')
div.find('.close').click()
})
- .on("hidden.bs.modal", function() {
+ .on("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
ok($('#modal-test').is(":visible"), 'modal visible')
div.modal("hide")
})
- .on("hidden.bs.modal", function() {
+ .on("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
ok($('#modal-test').is(":visible"), 'modal visible')
$('#modal-test').click()
})
- .bind("hidden.bs.modal", function() {
+ .bind("hidden.bs.modal", function () {
ok(!$('#modal-test').is(":visible"), 'modal hidden')
div.remove()
start()
triggered = 0
$('#modal-test').click()
})
- .one("hidden.bs.modal", function() {
+ .one("hidden.bs.modal", function () {
div.modal("show")
})
.bind("hide.bs.modal", function () {
$('#close').click()
ok(!$('#modal-test').is(":visible"), 'modal hidden')
})
- .one("hidden.bs.modal", function() {
+ .one("hidden.bs.modal", function () {
div.one('hidden.bs.modal', function () {
start()
}).modal("show")
}
// These methods connect QUnit to PhantomJS.
- QUnit.log = function(obj) {
+ QUnit.log = function (obj) {
// What is this I don’t even
if (obj.message === '[object Object], undefined:undefined') { return }
// Parse some stuff before sending it.
sendMessage('qunit.log', obj.result, actual, expected, obj.message, obj.source)
}
- QUnit.testStart = function(obj) {
+ QUnit.testStart = function (obj) {
sendMessage('qunit.testStart', obj.name)
}
- QUnit.testDone = function(obj) {
+ QUnit.testDone = function (obj) {
sendMessage('qunit.testDone', obj.name, obj.failed, obj.passed, obj.total)
}
- QUnit.moduleStart = function(obj) {
+ QUnit.moduleStart = function (obj) {
sendMessage('qunit.moduleStart', obj.name)
}
$('#qunit-fixture').empty()
})
- test("should respect custom classes", function() {
+ test("should respect custom classes", function () {
$.support.transition = false
var popover = $('<a href="#">@fat</a>')
.appendTo('#qunit-fixture')
})
test("should destroy popover", function () {
- var popover = $('<div/>').popover({trigger: 'hover'}).on('click.foo', function(){})
+ var popover = $('<div/>').popover({trigger: 'hover'}).on('click.foo', function (){})
ok(popover.data('bs.popover'), 'popover has data')
ok($._data(popover[0], 'events').mouseover && $._data(popover[0], 'events').mouseout, 'popover has hover event')
ok($._data(popover[0], 'events').click[0].namespace == 'foo', 'popover has extra click.foo event')
+ '</ul>'
$(dropHTML).find('ul>li:first a').tab('show').end()
- .find('ul>li:last a').on('show', function(event){
+ .find('ul>li:last a').on('show', function (event){
equal(event.relatedTarget.hash, "#1-1")
- }).on('shown', function(event){
+ }).on('shown', function (event){
equal(event.relatedTarget.hash, "#1-1")
}).tab('show')
})
test("should fire show event", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
- .on("show.bs.tooltip", function() {
+ .on("show.bs.tooltip", function () {
ok(true, "show was called")
start()
})
test("should fire shown event", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
- .on("shown.bs.tooltip", function() {
+ .on("shown.bs.tooltip", function () {
ok(true, "shown was called")
start()
})
test("should not fire shown event when default prevented", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
- .on("show.bs.tooltip", function(e) {
+ .on("show.bs.tooltip", function (e) {
e.preventDefault()
ok(true, "show was called")
start()
})
- .on("shown.bs.tooltip", function() {
+ .on("shown.bs.tooltip", function () {
ok(false, "shown was called")
})
.tooltip('show')
test("should fire hide event", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
- .on("shown.bs.tooltip", function() {
+ .on("shown.bs.tooltip", function () {
$(this).tooltip('hide')
})
- .on("hide.bs.tooltip", function() {
+ .on("hide.bs.tooltip", function () {
ok(true, "hide was called")
start()
})
test("should fire hidden event", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
- .on("shown.bs.tooltip", function() {
+ .on("shown.bs.tooltip", function () {
$(this).tooltip('hide')
})
- .on("hidden.bs.tooltip", function() {
+ .on("hidden.bs.tooltip", function () {
ok(true, "hidden was called")
start()
})
test("should not fire hidden event when default prevented", function () {
stop()
var tooltip = $('<div title="tooltip title"></div>')
- .on("shown.bs.tooltip", function() {
+ .on("shown.bs.tooltip", function () {
$(this).tooltip('hide')
})
- .on("hide.bs.tooltip", function(e) {
+ .on("hide.bs.tooltip", function (e) {
e.preventDefault()
ok(true, "hide was called")
start()
})
- .on("hidden.bs.tooltip", function() {
+ .on("hidden.bs.tooltip", function () {
ok(false, "hidden was called")
})
.tooltip('show')
})
test("should destroy tooltip", function () {
- var tooltip = $('<div/>').tooltip().on('click.foo', function(){})
+ var tooltip = $('<div/>').tooltip().on('click.foo', function (){})
ok(tooltip.data('bs.tooltip'), 'tooltip has data')
ok($._data(tooltip[0], 'events').mouseover && $._data(tooltip[0], 'events').mouseout, 'tooltip has hover event')
ok($._data(tooltip[0], 'events').click[0].namespace == 'foo', 'tooltip has extra click.foo event')
tooltip.tooltip('hide')
})
- test("should place tooltip inside window", function(){
+ test("should place tooltip inside window", function (){
var container = $("<div />").appendTo("body")
.css({position: "absolute", width: 200, height: 200, bottom: 0, left: 0})
, tooltip = $("<a href='#' title='Very very very very very very very very long tooltip'>Hover me</a>")
stop()
- setTimeout(function(){
+ setTimeout(function (){
ok($(".tooltip").offset().left >= 0)
start()
}, 100)
})
- test("should place tooltip on top of element", function(){
+ test("should place tooltip on top of element", function (){
var container = $("<div />").appendTo("body")
.css({position: "absolute", bottom: 0, left: 0, textAlign: "right", width: 300, height: 300})
, p = $("<p style='margin-top:200px' />").appendTo(container)
stop()
- setTimeout(function(){
+ setTimeout(function (){
var tooltip = container.find(".tooltip")
start()
}, 100)
})
- test("should add position class before positioning so that position-specific styles are taken into account", function(){
+ test("should add position class before positioning so that position-specific styles are taken into account", function (){
$("head").append('<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>')
var container = $("<div />").appendTo("body")
}
}
- Tooltip.prototype.applyPlacement = function(offset, placement) {
+ Tooltip.prototype.applyPlacement = function (offset, placement) {
var replace
var $tip = this.tip()
var width = $tip[0].offsetWidth
if (replace) $tip.offset(offset)
}
- Tooltip.prototype.replaceArrow = function(delta, dimension, position) {
+ Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
}