Skip to content

Commit

Permalink
Update AdvancedFilters.js
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaChiarani authored Apr 22, 2022
1 parent b0d1165 commit def0f2a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions js/AdvancedFilters.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* AdvancedFilters (https://github.com/GianlucaChiarani/AdvancedFilters)
* @version 0.5
* @version 0.6
* @author Gianluca Chiarani
* @license The MIT License (MIT)
*/
Expand Down Expand Up @@ -110,9 +110,9 @@

function getFieldHtml(name, operator = '', value = '') {
var field = settings.fields[name];
var label = field.label;
var type = field.type;
var options = field.options;
var label = (typeof field.label !== 'undefined'?field.label:name);
var type = (typeof field.type !== 'undefined'?field.type:'text');
var options = (typeof field.options !== 'undefined'?field.options:Object());

var typeD = 'text';

Expand Down Expand Up @@ -149,6 +149,8 @@

if (Object.keys(options).length) {
html += '<select class="value">';
html += '<option value=""></option>';

for (let key in options) {
var optionValue = key;
var optionLabel = options[key];
Expand Down Expand Up @@ -197,7 +199,7 @@
}

function t(string) {
if (typeof settings.translations[string] != 'undefined')
if (typeof settings.translations[string] !== 'undefined' && settings.translations[string] != '')
return settings.translations[string];
else
return string;
Expand Down

0 comments on commit def0f2a

Please sign in to comment.