revert part of rewrite, preparing for reverting the bad commit

This commit is contained in:
Felix Van der Jeugt 2015-09-11 10:24:29 +02:00
parent 8baaae8b16
commit 91a0023cd2

View file

@ -5,14 +5,14 @@
%h3.panel-title Filters %h3.panel-title Filters
.panel-body .panel-body
.pure-g .pure-g
.bound.input-listen.pure-u-1{ 'data-input-type': 'date-range', 'data-input-value': ''} .bound.input-listen.pure-u-1{ 'data-input-type': 'date-range' }
%fieldset.pure-group-inline %fieldset.pure-group-inline
%span.fa.fa-calendar.pure-group-addon %span.fa.fa-calendar.pure-group-addon
%input.lower-bound{type: 'date', placeholder: 'after'} %input.lower-bound{type: 'date', placeholder: 'after'}
\- \-
%input.upper-bound{type: 'date', placeholder: 'before'} %input.upper-bound{type: 'date', placeholder: 'before'}
.pure-g .pure-g
.bound.input-listen.pure-u-1{ 'data-input-type': 'number-range', 'data-input-value': ''} .bound.input-listen.pure-u-1{ 'data-input-type': 'number-range' }
%fieldset.pure-group-inline %fieldset.pure-group-inline
%span.icon-euro.pure-group-addon %span.icon-euro.pure-group-addon
%input.lower-bound.pure-group-addon{type: 'number', placeholder: 'Minimum'} %input.lower-bound.pure-group-addon{type: 'number', placeholder: 'Minimum'}
@ -21,11 +21,11 @@
%span.icon-euro.pure-group-addon %span.icon-euro.pure-group-addon
%input.upper-bound.pure-group-addon{type: 'number', placeholder: 'Maximum'} %input.upper-bound.pure-group-addon{type: 'number', placeholder: 'Maximum'}
.pure-g .pure-g
.input-listen.pure-u-md-1-4{ 'data-input-type': 'text', 'data-input-value': ''} .input-listen.pure-u-md-1-4{ 'data-input-type': 'text' }
%input{type: 'text', placeholder: 'Filter on Issuer'} %input{type: 'text', placeholder: 'Filter on Issuer'}
.input-listen.pure-u-md-1-4{ 'data-input-type': 'text', 'data-input-value': ''} .input-listen.pure-u-md-1-4{ 'data-input-type': 'text' }
%input{type: 'text', placeholder: 'Filter on Peer'} %input{type: 'text', placeholder: 'Filter on Peer'}
.input-listen.pure-u-md-1-2{ 'data-input-type': 'text', 'data-input-value': ''} .input-listen.pure-u-md-1-2{ 'data-input-type': 'text' }
%input{type: 'text', placeholder: 'Filter on Message'} %input{type: 'text', placeholder: 'Filter on Message'}
@ -63,6 +63,7 @@
$('.input-listen').each(function(index, element) { $('.input-listen').each(function(index, element) {
var filter = $(element); var filter = $(element);
var type = filter.attr('data-input-type'); var type = filter.attr('data-input-type');
var column = table.column(index);
filter.find('input').on('keyup change', function() { filter.find('input').on('keyup change', function() {
var value = null var value = null
if(filter.hasClass('bound')) { if(filter.hasClass('bound')) {
@ -72,10 +73,9 @@
} else { } else {
value = type + ':' + $(this).val(); value = type + ':' + $(this).val();
} }
if(filter.attr('data-input-value') !== value) { value = filter.attr('data-input-type') + ':' + value;
console.log(value); if(column.search() !== value) {
filter.attr('data-input-value', value); column.search(value).draw();
// TODO $.post(...)
} }
}); });
}); });