hide prev/next image buttons when splitBy is not active

This commit is contained in:
ahr
2017-12-10 17:28:29 +01:00
parent f2dfa92966
commit f17bc55a8f

View File

@@ -257,8 +257,7 @@ function enableSplitBy(fieldValues) {
splitBy['values'] = fieldValues;
splitBy['index'] = 0;
splitBy['query'] = $('#search-input').val();
$('#prev_image').show();
$('#next_image').show();
showSplitBy();
}
function disableSplitBy() {
@@ -266,6 +265,17 @@ function disableSplitBy() {
splitBy['values'] = [];
splitBy['index'] = 0;
splitBy['query'] = '';
hideSplitBy();
}
function showSplitBy(){
if(splitBy['values'].length > 0) {
$('#prev_image').show();
$('#next_image').show();
}
}
function hideSplitBy(){
$('#prev_image').hide();
$('#next_image').hide();
}
@@ -322,6 +332,7 @@ function showLoadingIcon()
{
//$('#result-view').html("<div class='center'><div class='uil-cube-css' style='-webkit-transform:scale(0.41)'><div /><div></div><div></div><div></div></div></div>");
$('#result-image').html("");
hideSplitBy();
startInvaders();
}
@@ -394,8 +405,10 @@ function sendPlotRequest(query){
var success = function(response){
$('#result-image').html('<img src=\"'+response.imageUrls+'" />');
showSplitBy();
};
var error = function(e) {
showSplitBy();
if (e.status == 404){
$('#result-image').text("No data points found for query: " + query);
}