From 6af0013ac52c391dd7623f9cbbb25cd7d3c43d35 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Thu, 16 Jan 2014 20:31:19 -0800 Subject: Revert "Add tooltip `viewport` option, respect bounds of the viewport" This reverts commit edb221a20ceabebd427e27d0432e94a227717217. Reverting due to broken JS unit tests. Conflicts: docs/javascript.html --- js/tests/unit/tooltip.js | 65 ++---------------------------------------------- 1 file changed, 2 insertions(+), 63 deletions(-) (limited to 'js/tests') diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 9fab6c61f..b9b003dd1 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -338,10 +338,10 @@ $(function () { }) test('should add position class before positioning so that position-specific styles are taken into account', function () { - $('head').append('') + $('head').append('') var container = $('
').appendTo('body'), - target = $('') + target = $('') .appendTo(container) .tooltip({placement: 'right'}) .tooltip('show'), @@ -353,67 +353,6 @@ $(function () { var topDiff = top - top2 ok(topDiff <= 1 && topDiff >= -1) target.tooltip('hide') - $('head #test').remove() - }) - - test('should adjust the tip\'s top when up against the top of the viewport', function () { - $('head').append('') - - var container = $('
').appendTo('body'), - target = $('') - .appendTo(container) - .tooltip({placement: 'right', viewportPadding: 12}) - .tooltip('show'), - tooltip = container.find('.tooltip') - - ok( Math.round(tooltip.offset().top) === 12 ) - target.tooltip('hide') - $('head #test').remove() - }) - - test('should adjust the tip\'s top when up against the bottom of the viewport', function () { - $('head').append('') - - var container = $('
').appendTo('body'), - target = $('') - .appendTo(container) - .tooltip({placement: 'right', viewportPadding: 12}) - .tooltip('show'), - tooltip = container.find('.tooltip') - - ok( Math.round(tooltip.offset().top) === Math.round($(window).height() - 12 - tooltip[0].offsetHeight) ) - target.tooltip('hide') - $('head #test').remove() - }) - - test('should adjust the tip\'s left when up against the left of the viewport', function () { - $('head').append('') - - var container = $('
').appendTo('body'), - target = $('') - .appendTo(container) - .tooltip({placement: 'bottom', viewportPadding: 12}) - .tooltip('show'), - tooltip = container.find('.tooltip') - - ok( Math.round(tooltip.offset().left) === 12 ) - target.tooltip('hide') - $('head #test').remove() - }) - - test('should adjust the tip\'s left when up against the right of the viewport', function () { - $('head').append('') - - var container = $('
').appendTo('body'), - target = $('') - .appendTo(container) - .tooltip({placement: 'bottom', viewportPadding: 12}) - .tooltip('show'), - tooltip = container.find('.tooltip') - - ok( Math.round(tooltip.offset().left) === Math.round($(window).width() - 12 - tooltip[0].offsetWidth) ) - target.tooltip('hide') - $('head #test').remove() }) test('tooltip title test #1', function () { -- cgit v1.2.3