hide prev/next image buttons when splitBy is not active
This commit is contained in:
@@ -257,8 +257,7 @@ function enableSplitBy(fieldValues) {
|
|||||||
splitBy['values'] = fieldValues;
|
splitBy['values'] = fieldValues;
|
||||||
splitBy['index'] = 0;
|
splitBy['index'] = 0;
|
||||||
splitBy['query'] = $('#search-input').val();
|
splitBy['query'] = $('#search-input').val();
|
||||||
$('#prev_image').show();
|
showSplitBy();
|
||||||
$('#next_image').show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableSplitBy() {
|
function disableSplitBy() {
|
||||||
@@ -266,6 +265,17 @@ function disableSplitBy() {
|
|||||||
splitBy['values'] = [];
|
splitBy['values'] = [];
|
||||||
splitBy['index'] = 0;
|
splitBy['index'] = 0;
|
||||||
splitBy['query'] = '';
|
splitBy['query'] = '';
|
||||||
|
hideSplitBy();
|
||||||
|
}
|
||||||
|
|
||||||
|
function showSplitBy(){
|
||||||
|
if(splitBy['values'].length > 0) {
|
||||||
|
$('#prev_image').show();
|
||||||
|
$('#next_image').show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function hideSplitBy(){
|
||||||
$('#prev_image').hide();
|
$('#prev_image').hide();
|
||||||
$('#next_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-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("");
|
$('#result-image').html("");
|
||||||
|
hideSplitBy();
|
||||||
startInvaders();
|
startInvaders();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,8 +405,10 @@ function sendPlotRequest(query){
|
|||||||
|
|
||||||
var success = function(response){
|
var success = function(response){
|
||||||
$('#result-image').html('<img src=\"'+response.imageUrls+'" />');
|
$('#result-image').html('<img src=\"'+response.imageUrls+'" />');
|
||||||
|
showSplitBy();
|
||||||
};
|
};
|
||||||
var error = function(e) {
|
var error = function(e) {
|
||||||
|
showSplitBy();
|
||||||
if (e.status == 404){
|
if (e.status == 404){
|
||||||
$('#result-image').text("No data points found for query: " + query);
|
$('#result-image').text("No data points found for query: " + query);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user