Commit 40d79b25 authored by Bruno Guillaume's avatar Bruno Guillaume
Browse files

improve corpus list display

parent 1038e937
......@@ -269,3 +269,14 @@ h3 {
.export-table-2 td:nth-child(2) {
text-align: center;
}
.corpus-folder {
background-color: #CCC;
border-top-style: solid;
border-top-width: thin;
}
.badge-danger {
float: right;
margin-right: 8px;
}
......@@ -976,9 +976,14 @@ function update_group() {
html += '<div class="panel panel-default">\n';
html += '<div class="panel-heading">\n';
html += '<h4 class="panel-title">\n';
html += '<a data-toggle="collapse" href="#' + href + '" id="folder_' + href + '">\n';
html += '<span class="glyphicon glyphicon-folder-open"></span>\n';
html += '<a onclick="toggle_folder_icon(\'' + href + '\');" data-toggle="collapse" href="#' + href + '" id="folder_' + href + '" class="collapsed corpus-folder">\n';
html += '<span id = "icon_'+href+'" class="glyphicon glyphicon-folder-close"></span>\n';
html += value["folder"] + '\n';
html += '<span class="badge badge-danger">'+value["corpora"].length+'</span>';
html += '</a>\n';
html += '</h4>\n';
html += '</div>\n';
......@@ -990,7 +995,7 @@ function update_group() {
esc_id = escape(id);
html += '<tr id="' + esc_id + '" class="corpus" onclick="set_corpus(\'' + id + '\');return false;"><td>\n';
html += '<a href="#" >\n';
html += '<span class="glyphicon glyphicon-align-justify"></span>\n';
html += '&#8627;<span class="glyphicon glyphicon-align-justify"></span>\n';
html += id + '\n';
html += '</a>\n';
if (value["no_word"]) {
......@@ -1011,6 +1016,21 @@ function update_group() {
update_corpus();
}
// ==================================================================================
function toggle_folder_icon(arg) {
let folder = $("#folder_"+arg);
let icon = $("#icon_"+arg);
if (folder.hasClass("collapsed")) {
console.log("OPEN");
icon.removeClass("glyphicon-folder-close");
icon.addClass("glyphicon-folder-open");
} else {
console.log("CLOSE");
icon.removeClass("glyphicon-folder-open");
icon.addClass("glyphicon-folder-close");
}
}
// ==================================================================================
function set_ud() {
$("#tables").show();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment