mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove unused smoothScrollTo directive
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
angular.module('Darkswarm').directive "ofnSmoothScrollTo", ($location, $document)->
|
||||
# Onclick sets $location.hash to attrs.ofnScrollTo
|
||||
# Then triggers $document.scrollTo
|
||||
restrict: 'A'
|
||||
link: (scope, element, attrs)->
|
||||
element.bind 'click', (ev)->
|
||||
ev.stopPropagation()
|
||||
$location.hash attrs.ofnScrollTo
|
||||
target = $("a[name='#{attrs.ofnSmoothScrollTo}']")
|
||||
# Scrolling is confused by our position:fixed top bar and page alert bar
|
||||
# - add an offset to scroll to the correct location, plus 5px buffer
|
||||
offset = $("nav.top-bar").height()
|
||||
offset += 5
|
||||
$document.scrollTo target, offset, 1000
|
||||
Reference in New Issue
Block a user