diff options
author | Chris Rebert <code@rebertia.com> | 2014-01-17 08:31:19 +0400 |
---|---|---|
committer | Chris Rebert <code@rebertia.com> | 2014-01-17 08:32:59 +0400 |
commit | 6af0013ac52c391dd7623f9cbbb25cd7d3c43d35 (patch) | |
tree | d4332bb7ccf9058c2369e52745c7b741a94a4fbe /js/tests/unit/tooltip.js | |
parent | faa783e9896c3353f9c4820dea5952bca900cda5 (diff) |
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
Diffstat (limited to 'js/tests/unit/tooltip.js')
-rw-r--r-- | js/tests/unit/tooltip.js | 65 |
1 files changed, 2 insertions, 63 deletions
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 9fab6c61f5..b9b003dd1d 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('<style id="test"> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>') + $('head').append('<style> .tooltip.right { white-space: nowrap; } .tooltip.right .tooltip-inner { max-width: none; } </style>') var container = $('<div />').appendTo('body'), - target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line" style="position: fixed; top: 10px; left: 0px;"></a>') + target = $('<a href="#" rel="tooltip" title="very very very very very very very very long tooltip in one line"></a>') .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('<style id="test"> .tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; } </style>') - - var container = $('<div />').appendTo('body'), - target = $('<a href="#" rel="tooltip" title="tip" style="position: fixed; top: 0px; left: 0px;"></a>') - .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('<style id="test"> .tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; } </style>') - - var container = $('<div />').appendTo('body'), - target = $('<a href="#" rel="tooltip" title="tip" style="position: fixed; bottom: 0px; left: 0px;"></a>') - .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('<style id="test"> .tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; } </style>') - - var container = $('<div />').appendTo('body'), - target = $('<a href="#" rel="tooltip" title="tip" style="position: fixed; top: 0px; left: 0px;"></a>') - .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('<style id="test"> .tooltip .tooltip-inner { width: 200px; height: 200px; max-width: none; } </style>') - - var container = $('<div />').appendTo('body'), - target = $('<a href="#" rel="tooltip" title="tip" style="position: fixed; top: 0px; right: 0px;"></a>') - .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 () { |