Merge pull request #202 from sosedoff/always-show-sidedebar

Display empty sidebar
This commit is contained in:
Dan Sosedoff 2016-11-15 22:06:18 -06:00 committed by GitHub
commit 20a5646a53
2 changed files with 278 additions and 194 deletions

File diff suppressed because one or more lines are too long

View File

@ -124,8 +124,6 @@ function buildSchemaSection(name, objects) {
section += "<div class='schema-container'>";
for (group of ["table", "view", "materialized_view", "sequence"]) {
if (objects[group].length == 0) continue;
group_klass = "";
if (name == "public" && group == "table") group_klass = "expanded";
@ -133,6 +131,8 @@ function buildSchemaSection(name, objects) {
section += "<div class='schema-group-title'><i class='fa fa-chevron-right'></i><i class='fa fa-chevron-down'></i> " + titles[group] + " (" + objects[group].length + ")</div>";
section += "<ul>"
if (!objects[group]) continue;
for (item of objects[group]) {
var id = name + "." + item;
section += "<li class='schema-" + group + "' data-type='" + group + "' data-id='" + id + "'>" + icons[group] + "&nbsp;" + item + "</li>";
@ -149,6 +149,15 @@ function loadSchemas() {
$("#objects").html("");
getObjects(function(data) {
if (Object.keys(data).length == 0) {
data["public"] = {
table: [],
view: [],
materialized_view: [],
sequence: []
};
}
for (schema in data) {
$(buildSchemaSection(schema, data[schema])).appendTo("#objects");
}