mirror of
https://github.com/sosedoff/pgweb.git
synced 2024-12-15 11:52:12 +03:00
Merge pull request #197 from sosedoff/sticky-tabs
Make tabs sticky: remember tab when switching between tables
This commit is contained in:
commit
ec013488ff
File diff suppressed because one or more lines are too long
@ -304,6 +304,9 @@ function setCurrentTab(id) {
|
|||||||
|
|
||||||
$("#nav ul li.selected").removeClass("selected");
|
$("#nav ul li.selected").removeClass("selected");
|
||||||
$("#" + id).addClass("selected");
|
$("#" + id).addClass("selected");
|
||||||
|
|
||||||
|
// Persist tab selection into the session storage
|
||||||
|
sessionStorage.setItem("tab", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showQueryHistory() {
|
function showQueryHistory() {
|
||||||
@ -815,7 +818,23 @@ $(document).ready(function() {
|
|||||||
$(".filters select, .filters input").val("");
|
$(".filters select, .filters input").val("");
|
||||||
|
|
||||||
showTableInfo();
|
showTableInfo();
|
||||||
showTableContent();
|
|
||||||
|
switch(sessionStorage.getItem("tab")) {
|
||||||
|
case "table_content":
|
||||||
|
showTableContent();
|
||||||
|
break;
|
||||||
|
case "table_structure":
|
||||||
|
showTableStructure();
|
||||||
|
break;
|
||||||
|
case "table_constraints":
|
||||||
|
showTableConstraints();
|
||||||
|
break;
|
||||||
|
case "table_indexes":
|
||||||
|
showTableIndexes();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
showTableContent();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#results").on("click", "a.row-action", function(e) {
|
$("#results").on("click", "a.row-action", function(e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user