@@ -499,7 +499,48 @@ describe "sticky columns", ->
499499 expect (top cell).toBe 22
500500 expect (cell .is (" .is_stuck" )).toBe false
501501 ]
502+
503+ it " uses set_bottom" , (done ) ->
504+ write_iframe ("""
505+ <div class="stick_header">
506+ <div class="stick_cell header"></div>
507+ <div class="stick_body"></div>
508+ </div>
509+ <script type="text/javascript">
510+ var navibar_height = 40
511+ $(".stick_cell").stick_in_parent({offset_top: $(window).height() - navibar_height, set_bottom: true, navibar_height: navibar_height})
512+ </script>
513+
514+ """ ).then (f) ->
515+ cell = f .find (" .stick_cell" )
516+
517+ # f.on "scroll", => console.warn f.scrollTop(), top cell
518+
519+ scroll_each f, done, [
520+ at 5 , =>
521+ expect (cell .is (" .is_stuck" )).toBe true
522+ expect (cell .css (" bottom" )).toBe " 0px"
523+
524+ at 15 , =>
525+ expect (cell .is (" .is_stuck" )).toBe true
526+ expect (cell .css (" bottom" )).toBe " 0px"
527+
528+ at 40 , =>
529+ expect (cell .is (" .is_stuck" )).toBe true
530+ expect (cell .css (" bottom" )).toBe " 0px"
502531
532+ at 125 , =>
533+ expect (cell .is (" .is_stuck" )).toBe true
534+ expect (cell .css (" bottom" )).toBe " 0px"
535+
536+ at 15 , =>
537+ expect (cell .is (" .is_stuck" )).toBe true
538+ expect (cell .css (" bottom" )).toBe " 0px"
539+
540+ at 0 , =>
541+ expect (cell .is (" .is_stuck" )).toBe true
542+ expect (cell .css (" bottom" )).toBe " 0px"
543+ ]
503544
504545 describe " events" , ->
505546 it " detects events when scrolling sticky header" , (done ) ->
@@ -719,4 +760,3 @@ scroll_each = (f, done, points) ->
719760 done ()
720761
721762 scroll_to_next ()
722-
0 commit comments