Commit 4a48f6ee authored by Sven Franck's avatar Sven Franck

app: fixed allow_new and loading pages without title

parent 7ea73355
......@@ -3292,9 +3292,7 @@
**/
// TODO: allow to run multiple mappers eg formItem + tableRow
map.element = function (element, wrapper, i) {
console.log(element)
if (wrapper.child_mapper) {
console.log("Child mapper...");
if (element.scheme) {
// NOTE: chaining allows the mapper to make additional async requests!
return map[wrapper.child_mapper]({
......@@ -3318,7 +3316,7 @@
})
.fail(app.util.error);
}
console.log("OUT")
return RSVP.resolve(wrapper.child_constructor({
"item": element,
"wrapper": wrapper,
......@@ -3403,9 +3401,7 @@
var quirk_dict, section, pos, label, j, k, field, setter, record, new_item,
id, key, obj, translation_fields, item;
console.log("HELLO")
console.log(spec)
translation_fields = "titletextlabel";
translation_fields = "titletextlabel";
quirk_dict = spec.wrapper.property_dict;
item = spec.item;
record = item.doc;
......@@ -5056,9 +5052,11 @@
if (util.testForString("ui-header", header.className)) {
title = header.getElementsByTagName("h1")[0];
title.setAttribute("data-i18n", (page_i18n || ""));
title.removeChild(title.childNodes[0]);
title.appendChild(document.createTextNode((value || "\u00A0")));
if (title) {
title.setAttribute("data-i18n", (page_i18n || ""));
title.removeChild(title.childNodes[0]);
title.appendChild(document.createTextNode((value || "\u00A0")));
}
}
// also set document title
document.title = value;
......@@ -6149,7 +6147,7 @@
}
// no items, need no show! (default to empty {} if none provided
if (pointer_results.data.total_rows === 0) {
if (quirk_dict.property_dict.allow_new) {
if (quirk_dict.allow_new) {
pointer_results = {"data": {"total_rows": 1, "rows": [{"doc": {}}]}};
} else {
quirk_dict.no_show = quirk_dict.no_items || {};
......
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