scroll to entry when opened

This commit is contained in:
Athou
2013-03-29 09:11:10 +01:00
parent e6f6148b27
commit b5a80b4493
2 changed files with 19 additions and 1 deletions

View File

@@ -1,5 +1,23 @@
var module = angular.module('commafeed.directives', []);
module.directive('scrollTo', function() {
return {
restrict : 'A',
controller : function($scope, $element, $attrs) {
},
link : function(scope, element, attrs) {
scope.$watch(attrs.scrollTo, function(value) {
if (value) {
$('html, body').animate({
scrollTop : $(element).offset().top + 'px'
}, 'fast');
}
});
}
};
});
module.directive('subscribe', function(SubscriptionService) {
return {
scope : {},