Use between numbers in filter box

issue8149
review53571002
This commit is contained in:
Cédric Krier
2019-03-08 23:50:42 +01:00
parent 35e082d2a5
commit 3146d9c45a
3 changed files with 33 additions and 0 deletions
+1
View File
@@ -1,3 +1,4 @@
* Use between numbers in filter box
* Fill 'to' with 'from' value on filter box
* Add tab domain in URL
* Use properties
+5
View File
@@ -122,6 +122,11 @@
}
}
input[type='number'] {
text-align: right;
text-align: end;
}
input[type='color'] {
.btn {
height: @line-height-base;
+27
View File
@@ -515,6 +515,12 @@
format, prefix + field.name);
input = entry.el;
break;
case 'integer':
case 'float':
case 'numeric':
entry = new Sao.ScreenContainer.Numbers(prefix + field.name);
input = entry.el;
break;
default:
entry = input = jQuery('<input/>', {
'class': 'form-control input-sm',
@@ -682,6 +688,27 @@
},
});
Sao.ScreenContainer.Numbers = Sao.class_(Sao.ScreenContainer.BetweenDates, {
init: function(id) {
Sao.ScreenContainer.Numbers._super.init.call(this, id);
this.from.change(this._from_changed.bind(this));
},
build_entry: function(placeholder, el) {
var entry = jQuery('<input/>', {
'class': 'form-control input-sm',
'type': 'number',
'step': 'any',
}).appendTo(el);
return entry;
},
_get_value: function(entry, value) {
return entry.val();
},
_set_value: function(entry, value) {
return entry.val(value);
},
});
Sao.ScreenContainer.Selection = Sao.class_(Object, {
init: function(selections, id) {
this.el = jQuery('<select/>', {