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

Unified Diff: pages/jobs.tmpl

Issue 5119420292661248: Properly react to hash changes and navigation (Closed)
Patch Set: Created Jan. 9, 2014, 10:11 p.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
@@ -14,12 +14,21 @@
{
activate: function(event, ui)
{
- location.hash = ui.newTab.find("a")[0].hash;
+ var hash = ui.newTab.find("a")[0].hash;
+ if (hash != "#jobs-overview")
+ location.hash = hash;
}
})
).addClass("ui-tabs-nav-vertical");
jQuery("#tabs-details").tabs();
+
+ jQuery(window).on("hashchange", function()
+ {
+ var hash = location.hash != "" ? location.hash : "#jobs-overview";
+ var escapedHash = hash.replace(/\+/g, "\\+");
+ jQuery("[href=" + escapedHash + "]").click();
+ });
});
</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