Commit 0e3f1f2f authored by Sven Franck's avatar Sven Franck

app: add data-widget/map to HTML output as hint on updates

parent 562301c6
......@@ -1827,6 +1827,7 @@
*/
// TODO: add collapsible support if needed
// TODO: dividers? will not be in spec, so can only be listview option!
// TODO: find better way to set mapper/widget
factory.widget.listview = function (spec) {
var fragment, has_filter, generator;
......@@ -1937,18 +1938,22 @@
(spec.inset ?
" ui-listview-inset ui-corner-all ui-shadow " : "")
},
"attributes": {"data-role": "listview", "data-enhanced": true},
"attributes": {
"data-role": "listview",
"data-enhanced": true,
// NOTE: on updates, we need wrapper with generator and mapper???
"data-widget": "listview"
},
"logic": {
"id": spec.id || null,
"data-update": spec.dynamic ? true : null,
// NOTE: on updates, we need wrapper with generator...
"data-widget": "listview",
"data-reference": spec.reference || null,
"data-filter": spec.filter || null,
"data-input": spec.input || null,
"data-filter-theme": spec.filter_theme || null,
"data-filter-placeholder": spec.placeholder || null,
"data-divider-theme": spec.divider_theme || null
"data-divider-theme": spec.divider_theme || null,
"data-map": spec.map_children || null
}
}));
}
......@@ -2297,7 +2302,8 @@
"attributes": {
"data-update": "true",
"data-widget": "table"
}
},
"logic": {"data-map": spec.map_children || null}
}));
break;
}
......@@ -4639,10 +4645,8 @@
{
"portal_type_source": config.state.type,
"portal_type_title": config.state.title,
"property_dict": util.mergeObject({
"dynamic": true,
"map_children": config.state.dyno_dict.map_children
},
"property_dict": util.mergeObject(
{"dynamic": true},
config.state.dyno_dict),
"scheme": config.state.scheme
},
......@@ -4893,10 +4897,8 @@
{
"portal_type_source": config.state.type,
"portal_type_title": config.state.title,
"property_dict": util.mergeObject({
"dynamic": true,
"map_children": config.state.dyno_dict.map_children
},
"property_dict": util.mergeObject(
{"dynamic": true},
config.state.dyno_dict),
"scheme": config.state.scheme
},
......@@ -6313,12 +6315,14 @@
}
}
} else {
// TODO: can this be done without storing on and querying DOM???
widget = pass.state.gadget.querySelector("[data-update]")
.getAttribute("data-widget");
wrapper.property_dict.map_children = widget.getAttribute("data-map");
wrapper = util.mergeObject(
factory.widget[widget](wrapper.property_dict),
factory.widget[widget.getAttribute("data-widget")](wrapper.property_dict),
wrapper
);
// add scheme and field_dict to list
kids = util.inherit(
pointer_results.data.rows,
......@@ -6437,6 +6441,7 @@
for (k = 0, l = response_list.length; k < l; k += 1) {
response = response_list[k];
done_target = undefined;
if (response) {
// generate target for and append response
// NOTE: wrapper.spec is used for header only.
......
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