search: add directive for endless scrolling

the directive will check whether the element is visible in viewport.