Added js and button, only flushing input value from parent form

This commit is contained in:
JC 2016-11-07 10:30:45 +01:00
parent b03dd07d97
commit 926d705806
3 changed files with 9 additions and 4 deletions

View file

@ -7,6 +7,9 @@ function filters_init() {
filter_framed_show(event);
filter_framed_close_all_excepted(framed_id(event));
});
$(".erase-filter").on('click', function (event) {
$(this).parent().find(".filter_input").val("");
});
}
function filter_framed_close_all_excepted(id) {
@ -24,4 +27,4 @@ function filter_framed_show(event) {
dom_object.css('top', (event.pageY + 7) + 'px');
dom_object.css('left', (event.pageX + 7) + 'px');
}
}

View file

@ -30,4 +30,4 @@ function pref_list_dossier_close_action() {
}
)
});
}
}

View file

@ -3,6 +3,8 @@
= preference.libelle
=form_tag @dossiers_list_facade.filter_url, {class: 'panel-body form-inline', method: :post} do
%input.form-control.filter_input{name: "filter_input[#{preference.table_attr}]", style:'width: 84%', value: "#{preference.filter}"}
%input.form-control.filter_input{name: "filter_input[#{preference.table_attr}]", style:'width: 69%', value: "#{preference.filter}"}
%button.btn.btn-sm.btn-success
%i.fa.fa-check
%i.fa.fa-check
%div.btn.btn-sm.btn-danger.erase-filter
%i.fa.fa-remove