NIHVIVO-2787 Fix js to handle unexpected empty individual set returned from controller
This commit is contained in:
parent
6f65d712cc
commit
59e3150fc3
1 changed files with 9 additions and 3 deletions
|
@ -215,6 +215,8 @@ var browseByVClass = {
|
||||||
|
|
||||||
// Add active class for requested alpha
|
// Add active class for requested alpha
|
||||||
$('#alpha-browse-individuals li a[data-alpha="'+ alpha +'"]').addClass('selected');
|
$('#alpha-browse-individuals li a[data-alpha="'+ alpha +'"]').addClass('selected');
|
||||||
|
|
||||||
|
return alpha;
|
||||||
},
|
},
|
||||||
|
|
||||||
// Wipe the currently displayed individuals, no-content message, and existing pagination
|
// Wipe the currently displayed individuals, no-content message, and existing pagination
|
||||||
|
@ -226,16 +228,20 @@ var browseByVClass = {
|
||||||
|
|
||||||
// When no individuals are returned for the AJAX request, print a reasonable message for the user
|
// When no individuals are returned for the AJAX request, print a reasonable message for the user
|
||||||
emptyResultSet: function(vclass, alpha) {
|
emptyResultSet: function(vclass, alpha) {
|
||||||
|
var nothingToSeeHere;
|
||||||
|
|
||||||
this.wipeSlate();
|
this.wipeSlate();
|
||||||
this.selectedAlpha(alpha);
|
alpha = this.selectedAlpha(alpha);
|
||||||
|
|
||||||
if ( alpha != "all" ) {
|
if ( alpha != "all" ) {
|
||||||
nothingToSeeHere = '<p class="no-individuals">There are no '+ vclass.name +' individuals whose name starts with <em>'+ alpha.toUpperCase() +'</em>.</p> <p class="no-individuals">Please try another letter or browse all.</p>';
|
nothingToSeeHere = '<p class="no-individuals">There are no '+ vclass.name +' individuals whose name starts with <em>'+ alpha.toUpperCase() +'</em>.</p> <p class="no-individuals">Please try another letter or browse all.</p>';
|
||||||
} else {
|
} else {
|
||||||
nothingToSeeHere = '<p class="no-individuals">There are no '+ vclass.name +' individuals in the system.</p> <p class="no-individuals">Please select another class from the list.</p>';
|
nothingToSeeHere = '<p class="no-individuals">There are no '+ vclass.name +' individuals in the system.</p> <p class="no-individuals">Please select another class from the list.</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
browseByVClass.individualsContainer.prepend(nothingToSeeHere);
|
browseByVClass.individualsContainer.prepend(nothingToSeeHere);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue