-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
We should make the header scroll logic in the alchMenu directive generic and include it in a utils package. I am currently re-using it in Katello thusly:
angular.module('alchemy').directive('scrollWithPage', ['$window', function ($window) {
return {
link: function (scope, element){
var element_original_offset = $(element).offset().top;
angular.element($window).bind('scroll', function () {
var window_scroll_top = $($window).scrollTop();
if (window_scroll_top > element_original_offset) {
element.addClass('scrolling');
} else {
element.removeClass('scrolling');
}
});
}
};
}]);