Commit a473fce9 authored by Sven Franck's avatar Sven Franck

app: override filter generation in widget if filter exist in page

parent 5383329b
...@@ -1845,7 +1845,7 @@ ...@@ -1845,7 +1845,7 @@
// TODO: dividers? will not be in spec, so can only be listview option! // TODO: dividers? will not be in spec, so can only be listview option!
// TODO: find better way to set mapper/widget // TODO: find better way to set mapper/widget
factory.widget.listview = function (spec) { factory.widget.listview = function (spec) {
var fragment, has_filter, generator; var fragment, has_filter, generator, filter_id;
// generate list item // generate list item
generator = function (generator_spec) { generator = function (generator_spec) {
...@@ -1934,17 +1934,18 @@ ...@@ -1934,17 +1934,18 @@
// search filter // search filter
if (spec.update !== true) { if (spec.update !== true) {
// NOTE: if input provided, the filter is already there! // NOTE: if input provided, the filter is already there!
// THIS MAKES B if (spec.filter) {
if (spec.filter && !spec.input) {
has_filter = true; has_filter = true;
fragment.appendChild(factory.widget.formElement( filter_id = spec.input || spec.id || "search";
factory.util.searchBarTemplate({ if (!spec.input) {
"search_id": spec.id || "search", fragment.appendChild(factory.widget.formElement(
"text": spec.text || "", factory.util.searchBarTemplate({
"text_i18n": spec.text_i18n || null "search_id": filter_id,
}) "text": spec.text || "",
"text_i18n": spec.text_i18n || null
)); })
));
}
} }
fragment.appendChild(factory.element({ fragment.appendChild(factory.element({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment