diff options
| author | fat <[email protected]> | 2014-07-06 21:50:46 -0700 |
|---|---|---|
| committer | fat <[email protected]> | 2014-07-06 21:50:46 -0700 |
| commit | 587c09cb4859cbed5d19cfc161a7c0b6711da51a (patch) | |
| tree | 0869cfd3fb88a61673376e969f7cd7b4276be247 | |
| parent | b5d86ad0bd47cae4e12126d8b84ca49d6c415e5d (diff) | |
| download | bootstrap-587c09cb4859cbed5d19cfc161a7c0b6711da51a.tar.xz bootstrap-587c09cb4859cbed5d19cfc161a7c0b6711da51a.zip | |
fix scrollspy test in firefox mac os
| -rw-r--r-- | js/tests/unit/scrollspy.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js index 084e6fe6e..b18d91189 100644 --- a/js/tests/unit/scrollspy.js +++ b/js/tests/unit/scrollspy.js @@ -124,17 +124,17 @@ $(function () { test('should add the active class to the correct element', function () { var navbarHtml = - '<div class="navbar">' + - '<ul class="nav">' + - '<li id="li-1"><a href="#div-1">div 1</a></li>' + - '<li id="li-2"><a href="#div-2">div 2</a></li>' + - '</ul>' + - '</div>' + '<div class="navbar">' + + '<ul class="nav">' + + '<li id="li-1"><a href="#div-1">div 1</a></li>' + + '<li id="li-2"><a href="#div-2">div 2</a></li>' + + '</ul>' + + '</div>' var contentHtml = - '<div class="content" style="overflow: auto; height: 50px">' + - '<div id="div-1" style="height: 100px; padding: 0; margin: 0">div 1</div>' + - '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + - '</div>' + '<div class="content" style="overflow: auto; height: 50px">' + + '<div id="div-1" style="height: 100px; padding: 0; margin: 0">div 1</div>' + + '<div id="div-2" style="height: 200px; padding: 0; margin: 0">div 2</div>' + + '</div>' $(navbarHtml).appendTo('#qunit-fixture') var $content = $(contentHtml) @@ -143,7 +143,7 @@ $(function () { var testElementIsActiveAfterScroll = function (element, target) { var deferred = $.Deferred() - var scrollHeight = $content.scrollTop() + $(target).position().top + var scrollHeight = Math.ceil($content.scrollTop() + $(target).position().top) stop() $content.one('scroll', function () { ok($(element).hasClass('active'), 'target:' + target + ', element' + element) |
