btq
.directive("scroll", function ($window,ui) {
    return function(scope, element, attrs) {
        angular.element($window).bind("scroll", function() {
             if (this.pageYOffset >= 10) {
                 ui.activeSearch();
             } else {
                //ui.inactiveSearch();
             }
            scope.$apply();
        });
    };
})
.directive("startSearch",function($window,ui){
    return {
        restrict: 'A',
        link: function(scope,element,attrs){
            element
            .on("focusin",function(){
                $("#flickr-box").fadeOut();
                ui.activeSearch();
            })
            .on("focusout",function(){
                $("#flickr-box").fadeIn();
            })
        }
    }
});