Generalize requests without arguments in JS

This commit adds a list of request types that do not have
parameters. These reqeusts are handled different by the JS code, and
the list makes it easier to add new custom commands that do not have
arguments.
This commit is contained in:
Ryan Balandran 2020-11-17 16:32:04 -06:00 committed by Italo Cunha
parent 96249a36d0
commit 42a935851a
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
const noArgReqs = ["summary"];
$(window).unload(function(){
$(".progress").show()
@ -12,7 +12,7 @@ function change_url(loc){
function reload(){
loc = "/" + request_type + "/" + hosts + "/" + proto;
if (request_type != "summary" ){
if (!noArgReqs.includes(request_type)){
if( request_args != undefined && request_args != ""){
loc = loc + "?q=" + encodeURIComponent(request_args);
change_url(loc)
@ -22,7 +22,7 @@ function reload(){
}
}
function update_view(){
if (request_type == "summary")
if (noArgReqs.includes(request_type))
$(".navbar-search").hide();
else
$(".navbar-search").show();