MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / scroll

Function scroll

lib/test/angular/1.5.0/angular.js:4873–4888  ·  view source on GitHub ↗
(hash)

Source from the content-addressed store, hash-verified

4871 }
4872
4873 function scroll(hash) {
4874 hash = isString(hash) ? hash : $location.hash();
4875 var elm;
4876
4877 // empty hash, scroll to the top of the page
4878 if (!hash) scrollTo(null);
4879
4880 // element with given id
4881 else if ((elm = document.getElementById(hash))) scrollTo(elm);
4882
4883 // first anchor with given name :-D
4884 else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);
4885
4886 // no element and hash == 'top', scroll to the top of the page
4887 else if (hash === 'top') scrollTo(null);
4888 }
4889
4890 // does not scroll when user clicks on anchor link that is currently on
4891 // (no url change, no $location.hash() change), browser native does scroll

Callers

nothing calls this directly

Calls 3

isStringFunction · 0.70
scrollToFunction · 0.70
getFirstAnchorFunction · 0.70

Tested by

no test coverage detected