Skip to content

Commit

Permalink
shift popover logic a bit to fix chance of undefined error
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Jun 4, 2024
1 parent db71e05 commit ab35031
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/js/widgets/search_bar/search_bar_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,6 @@ define([
this.$input = $input;
renderAutocomplete($input);

$input.popover({
placement: 'bottom',
title: 'Empty Search!',
content: 'Please enter a query to search.',
animation: true,
trigger: 'manual',
});

this.$('[data-toggle="tooltip"]').tooltip();
},

Expand Down Expand Up @@ -432,13 +424,25 @@ define([
!this.model.get('bigquery')
) {
// show a popup to tell the user to type in a query
$input.popover('show');
$input.on('input change blur', function () {
$input
.popover({
placement: 'bottom',
title: 'Empty Search!',
content: 'Please enter a query to search.',
animation: true,
trigger: 'manual',
})
.popover('show');

$input.on('input change blur', function() {
$(this).popover('hide');
});
return false;
}
$input.popover('hide');

if (typeof $input.popover === 'function') {
$input.popover('hide');
}

// replace uppercased fields with lowercase
query = query.replace(/([A-Z])\w+:/g, function (letter) {
Expand Down

0 comments on commit ab35031

Please sign in to comment.