Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: pages/jobs.tmpl

Issue 6034776070815744: Used history API and prevent scrolling to anchor when opening a job link (Closed)
Patch Set: Don't use history API for compatibility with ancient browsers ;P Created Jan. 10, 2014, 10:02 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pages/jobs.tmpl
===================================================================
--- a/pages/jobs.tmpl
+++ b/pages/jobs.tmpl
@@ -16,7 +16,10 @@
{
var hash = ui.newTab.find("a")[0].hash;
if (hash != "#jobs-overview")
+ {
location.hash = hash;
+ window.scrollTo(0, 0);
+ }
}
})
).addClass("ui-tabs-nav-vertical");
@@ -29,6 +32,8 @@
var escapedHash = hash.replace(/\+/g, "\\+");
jQuery("[href=" + escapedHash + "]").click();
});
+
+ setTimeout(function() { window.scrollTo(0, 0); }, 0);
});
</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld