Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.on('afterUpdateRuleFilter afterUpdateRuleOperator', function(e, rule) {
let $b = rule.$el.find('button.filter-description');
const description = e.builder.getFilterDescription(rule.filter, rule);
if(!description) {
$b.hide();
} else {
if($b.length === 0) {
$b = $('<button class="btn btn-sm btn-info filter-description btn-tooltip tooltip-trigger" type="button"><i class="fas fa-question-circle"></i></button>');
$b.prependTo(rule.$el.find(QueryBuilder.selectors.rule_actions));
} else {
$b.css('display', '');
}
$b.attr('data-tippy-content', description);
}
});
});