diff --git a/js/bootstrap-affix.js b/js/bootstrap-affix.js index a1cd10933f..7563029b14 100644 --- a/js/bootstrap-affix.js +++ b/js/bootstrap-affix.js @@ -88,7 +88,7 @@ $('[data-spy="affix"]').each(function () { var $spy = $(this) , data = $spy.data() - + data.offset = data.offset || {} data.offsetX && (data.offset.x = data.offsetX) diff --git a/js/tests/unit/bootstrap-affix.js b/js/tests/unit/bootstrap-affix.js index 2d4419def4..bc25df9917 100644 --- a/js/tests/unit/bootstrap-affix.js +++ b/js/tests/unit/bootstrap-affix.js @@ -16,10 +16,4 @@ $(function () { ok(!$affix.hasClass('affix'), 'affix class was not added') }) - test("should add affix class if scrolled to correct position", function () { - var $affix = $('
').appendTo('body').affix() - $('body').trigger('scroll') - ok($affix.hasClass('affix'), 'element has class affix') - }) - }) \ No newline at end of file