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: Created Jan. 10, 2014, 8:59 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
@@ -15,8 +15,8 @@
activate: function(event, ui)
{
var hash = ui.newTab.find("a")[0].hash;
- if (hash != "#jobs-overview")
- location.hash = hash;
+ if ((hash != "#jobs-overview" ? hash : "") != document.location.hash)
+ history.pushState(null, null, hash);
}
})
).addClass("ui-tabs-nav-vertical");
@@ -29,6 +29,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