}, this);
},
add: function (values, options) {
- options || (options = {});
+ options = options || {};
if (!(values instanceof Array)) {
values = [values];
}
return this;
},
toggle: function (value, options) {
- options || (options = {});
+ options = options || {};
var facet = this.detect(function (facet) {
return facet.get('category') === value.category
if (!contexts.length) { return; }
if (contexts.length === 1) { return contexts[0]; }
- return _.extend(new instance.web.CompoundContext, {
+ return _.extend(new instance.web.CompoundContext(), {
__contexts: contexts
});
},
if (contexts.length === 1) { return contexts[0]; }
- return _.extend(new instance.web.CompoundContext, {
+ return _.extend(new instance.web.CompoundContext(), {
__contexts: contexts
});
},
domains.unshift(['|']);
}
- return _.extend(new instance.web.CompoundDomain, {
+ return _.extend(new instance.web.CompoundDomain(), {
__domains: domains
});
}
},
changed: function() {
var nval = this.$(".searchview_extended_prop_field").val();
- if(this.attrs.selected == null || nval != this.attrs.selected.name) {
+ if(this.attrs.selected === null || this.attrs.selected === undefined || nval != this.attrs.selected.name) {
this.select_field(_.detect(this.fields, function(x) {return x.name == nval;}));
}
},
*/
select_field: function(field) {
var self = this;
- if(this.attrs.selected != null) {
+ if(this.attrs.selected !== null && this.attrs.selected !== undefined) {
this.value.destroy();
this.value = null;
this.$('.searchview_extended_prop_op').html('');
}
this.attrs.selected = field;
- if(field == null) {
+ if(field === null || field === undefined) {
return;
}
},
get_proposition: function() {
- if ( this.attrs.selected == null)
+ if (this.attrs.selected === null || this.attrs.selected === undefined)
return null;
var field = this.attrs.selected;
var op_select = this.$('.searchview_extended_prop_op')[0];
get_value: function() {
try {
var val =this.$el.val();
- return instance.web.parse_value(val == "" ? 0 : val, {'widget': 'integer'});
+ return instance.web.parse_value(val === "" ? 0 : val, {'widget': 'integer'});
} catch (e) {
return "";
}
get_value: function() {
try {
var val =this.$el.val();
- return instance.web.parse_value(val == "" ? 0.0 : val, {'widget': 'float'});
+ return instance.web.parse_value(val === "" ? 0.0 : val, {'widget': 'float'});
} catch (e) {
return "";
}