mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Scroll past header on shops page if user is logged in
This commit is contained in:
@@ -2,10 +2,9 @@ Darkswarm.directive 'scrollAfterLoad', ($timeout, $location, $document)->
|
||||
# Scroll to an element on page load
|
||||
restrict: "A"
|
||||
link: (scope, element, attr) ->
|
||||
if scope.$last is true
|
||||
$(window).load ->
|
||||
$timeout ->
|
||||
elem = $("##{$location.hash()}")
|
||||
if elem.length > 0
|
||||
$document.scrollTo elem , 100, 200, (x)->
|
||||
x * (2 - x)
|
||||
elem = element
|
||||
$(window).load ->
|
||||
$timeout ->
|
||||
if elem?
|
||||
$document.scrollTo elem, 100, 200, (x) ->
|
||||
x * (2 - x)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
= inject_enterprises
|
||||
= inject_enterprises
|
||||
|
||||
#hubs.hubs{"ng-controller" => "EnterprisesCtrl"}
|
||||
.row
|
||||
.small-12.columns
|
||||
%h1 Shop in your local area
|
||||
%h1{"scroll-after-load" => (spree_current_user ? true : nil)} Shop in your local area
|
||||
|
||||
= render partial: "shared/components/enterprise_search"
|
||||
= render partial: "home/filters"
|
||||
@@ -12,7 +13,6 @@
|
||||
.active_table
|
||||
%hub.active_table_node.row.animate-repeat{"ng-repeat" => "hub in filteredEnterprises = (Enterprises.hubs | visible | searchEnterprises:query | taxons:activeTaxons | shipping:shippingTypes | showHubProfiles:show_profiles | orderBy:['-active', '+orders_close_at'])",
|
||||
"ng-class" => "{'is_profile' : hub.category == 'hub_profile', 'closed' : !open(), 'open' : open(), 'inactive' : !hub.active, 'current' : current()}",
|
||||
"scroll-after-load" => true,
|
||||
"ng-controller" => "HubNodeCtrl",
|
||||
id: "{{hub.hash}}"}
|
||||
.small-12.columns
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
.small-12.columns
|
||||
.active_table
|
||||
%producer.active_table_node.row.animate-repeat{id: "{{producer.path}}",
|
||||
"scroll-after-load" => true,
|
||||
"ng-repeat" => "producer in filteredEnterprises = (Enterprises.producers | visible | searchEnterprises:query | taxons:activeTaxons)",
|
||||
"ng-controller" => "ProducerNodeCtrl",
|
||||
"ng-class" => "{'closed' : !open(), 'open' : open(), 'inactive' : !producer.active}",
|
||||
|
||||
Reference in New Issue
Block a user