Adding smooth scroll to hubses

This commit is contained in:
Will Marshall
2014-06-12 16:16:46 +10:00
parent a55e58d50c
commit 365c14d4fe
3 changed files with 3 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, Navigation, $location, $anchorScroll, $templateCache, CurrentHub) ->
Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, Navigation, $location, $templateCache, CurrentHub) ->
$scope.toggle = ->
HashNavigation.toggle $scope.hub.hash
@@ -7,6 +7,3 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, Navigation, $locati
$scope.current = ->
$scope.hub.id is CurrentHub.id
if $scope.open()
$anchorScroll()

View File

@@ -4,4 +4,4 @@ Darkswarm.controller "HubsCtrl", ($scope, Hubs, $anchorScroll, $rootScope, HashN
$rootScope.$on "$locationChangeSuccess", (newRoute, oldRoute) ->
if HashNavigation.active "hubs"
$anchorScroll()
$document.scrollTo $("#hubs"), 100, 200

View File

@@ -25,6 +25,7 @@
.active_table
%hub.active_table_node.row{"ng-repeat" => "hub in filteredHubs = (hubs | hubs:query)",
"ng-class" => "{'closed' : !open(), 'open' : open(), 'inactive' : !hub.active, 'current' : current()}",
"scroll-after-load" => true,
"ng-controller" => "HubNodeCtrl",
id: "{{hub.hash}}"}
.small-12.columns