From 5f242f92325cd9115062b8a80c436b5cfe4cc651 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Wed, 25 Jun 2014 10:46:32 +1000 Subject: [PATCH] Fixing groups page anchor scrolling --- .../darkswarm/controllers/groups_controller.js.coffee | 6 ++++-- app/views/groups/index.html.haml | 5 +++-- app/views/shopping_shared/_groups.html.haml | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/groups_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/groups_controller.js.coffee index 850f58b33e..4bb856ace4 100644 --- a/app/assets/javascripts/darkswarm/controllers/groups_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/groups_controller.js.coffee @@ -2,5 +2,7 @@ Darkswarm.controller "GroupsCtrl", ($scope, Groups, $anchorScroll, $rootScope) - $scope.Groups = Groups $scope.order = 'position' - $rootScope.$on "$locationChangeSuccess", (newRoute, oldRoute) -> - $anchorScroll() + #$rootScope.$on "$locationChangeSuccess", (newRoute, oldRoute) -> + #$anchorScroll() + # + # diff --git a/app/views/groups/index.html.haml b/app/views/groups/index.html.haml index bf94e690ab..dd37a32b78 100644 --- a/app/views/groups/index.html.haml +++ b/app/views/groups/index.html.haml @@ -1,4 +1,5 @@ = inject_enterprises + :javascript angular.module('Darkswarm').value('groups', #{render partial: "json/groups", object: @groups}) @@ -38,9 +39,9 @@ .small-6.columns %h5 Our hubs & producers %ul.small-block-grid-2 - %li{"ng-repeat" => "enterprise in group.enterprises"} + %li{"ng-repeat" => "enterprise in group.enterprises", "scroll-after-load" => true} %hub-modal{"ng-if" => "enterprise.is_distributor"} - %producer-modal{"ng-if" => "!enterprise.is_distributor"} + %producer-modal{"ng-if" => "!enterprise.is_distributor", "show-hub-actions" => 'true'} .row.group_footer .small-12.columns diff --git a/app/views/shopping_shared/_groups.html.haml b/app/views/shopping_shared/_groups.html.haml index 19c0912ec6..e20ef64116 100644 --- a/app/views/shopping_shared/_groups.html.haml +++ b/app/views/shopping_shared/_groups.html.haml @@ -8,4 +8,7 @@ %ul.bullet-list - for group in current_distributor.groups %li - %a{href: main_app.groups_path(anchor: "#/#group#{group.id}")}= group.name + = group.id + %a{href: main_app.groups_path + "/#/#group#{group.id}"} + = group.name +