Scrolling to groups when hotlinked

This commit is contained in:
Will Marshall
2014-05-29 16:31:12 +10:00
parent c49d9d838c
commit d5a652182e
3 changed files with 8 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
Darkswarm.controller "GroupsCtrl", ($scope, Groups) ->
Darkswarm.controller "GroupsCtrl", ($scope, Groups, $anchorScroll, $rootScope) ->
$scope.Groups = Groups
$scope.order = 'position'
$rootScope.$on "$locationChangeSuccess", (newRoute, oldRoute) ->
$anchorScroll()

View File

@@ -17,8 +17,9 @@
"ng-debounce" => "150",
"ofn-disable-enter" => true}
.group{"ng-repeat" => "group in Groups.groups | filter:query | orderBy:order"}
.group{"ng-repeat" => "group in Groups.groups | filter:query | orderBy:order",
name: "group{{group.id}}",
id: "group{{group.id}}"}
.row.pad-top{bindonce: true}
.small-12.columns
.group-hero

View File

@@ -2,4 +2,4 @@
%ul
- for group in current_distributor.groups
%li
%a{href: main_app.groups_path}= group.name
%a{href: main_app.groups_path(anchor: "#/#group#{group.id}")}= group.name