UI and design tweaks

This commit is contained in:
Dan Sosedoff
2017-10-13 23:04:19 -05:00
parent fc01b1db81
commit 046022221e
4 changed files with 68 additions and 24 deletions

View File

@@ -857,6 +857,27 @@ function toggleDatabaseSearch() {
$("#database_search").toggle();
}
function enableDatabaseSearch(data) {
var input = $("#database_search");
input.typeahead("destroy");
input.typeahead({
source: data,
minLength: 0,
items: "all",
autoSelect: false,
fitToElement: true
});
input.typeahead("lookup").focus();
input.on("focusout", function(e){
toggleDatabaseSearch();
input.off("focusout");
});
}
$(document).ready(function() {
$("#table_content").on("click", function() { showTableContent(); });
$("#table_structure").on("click", function() { showTableStructure(); });
@@ -1051,20 +1072,7 @@ $(document).ready(function() {
$("#current_database").on("click", function(e) {
apiCall("get", "/databases", {}, function(resp) {
toggleDatabaseSearch();
var input = $("#database_search");
input.typeahead("destroy");
input.typeahead({
source: resp,
minLength: 0,
items: "all",
autoSelect: false,
fitToElement: true
});
input.typeahead("lookup").focus();
input.on("focusout", function(e){
toggleDatabaseSearch();
input.off("focusout");
});
enableDatabaseSearch(resp);
});
});