Skip to content

Commit

Permalink
BUG: Fix issue with "No results found" message
Browse files Browse the repository at this point in the history
Fixes an extraneous tooltip (for the plotMenu) would erroneously show on
screen. We change the context where the tooltip exists and limit it to
be the search bar only.
  • Loading branch information
ElDeveloper committed Oct 9, 2019
1 parent d8afd55 commit 050cd3c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions emperor/support_files/js/view-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,17 @@ define([
// there's a few attributes we can only set on "ready" so list them up here
$(function() {
scope.$searchBar.tooltip({
content: 'No results found!',
disabled: true,
// place the element with a slight offset at the bottom of the input
// so that it doesn't overlap with the "continuous values" elements
position: {my: 'center top+40', at: 'center bottom'},
position: {my: 'center top+40', at: 'center bottom',
of: scope.$searchBar},
// prevent the tooltip from disappearing when there's no matches
close: function() {
close: function(event, ui) {
if (scope.bodyGrid.getDataLength() === 0 &&
scope.$searchBar.val() !== '') {
$(this).tooltip('open');
scope.$searchBar.tooltip('open');
}
}
});
Expand Down Expand Up @@ -390,12 +392,10 @@ define([
// show a message when no results are found
if (scope.bodyGrid.getDataLength() === 0 &&
scope.$searchBar.val() !== '') {
scope.$searchBar.attr('title', 'No results found!');
scope.$searchBar.tooltip('option', 'disabled', false);
scope.$searchBar.tooltip('open');
}
else {
scope.$searchBar.attr('title', '');
scope.$searchBar.tooltip('option', 'disabled', true);
scope.$searchBar.tooltip('close');
}
Expand Down

0 comments on commit 050cd3c

Please sign in to comment.