Commit 11804cdf authored by Sven Franck's avatar Sven Franck

bugfix: wrong object reference and query parameter

parent ef03d483
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"portal_type_source": "Application Categories", "portal_type_source": "Application Categories",
"portal_type_title": "category", "portal_type_title": "category",
"portal_type_fields": "category_fieldlist", "portal_type_fields": "category_fieldlist",
"initial_query": {"include_documents": true, "limit":[]}, "initial_query": {"include_docs": true, "limit":[]},
"form": null, "form": null,
"property_dict": {}, "property_dict": {},
"children": [{ "children": [{
......
...@@ -3279,15 +3279,15 @@ ...@@ -3279,15 +3279,15 @@
pointer, pointer,
zero_no_show, zero_no_show,
select_counter, select_counter,
no_limit,
no_items,
info_field_list = element.querySelectorAll(".info"), info_field_list = element.querySelectorAll(".info"),
info = ""; info = "";
// TODO: ..... crap // TODO: ..... redo
// on updates, info_field_list may be empty, because only part of the // on updates, info_field_list may be empty, because only part of the
// gadget is updated. Need to find info_fields by hand // gadget is updated. Need to find info_fields by hand
if (info_field_list.length === 0) { if (info_field_list.length === 0) {
// switch from NodeList to array
info_field_list = []; info_field_list = [];
selection = document.querySelectorAll(".info"); selection = document.querySelectorAll(".info");
for (i = 0; i < selection.length; i += 1) { for (i = 0; i < selection.length; i += 1) {
...@@ -3296,7 +3296,6 @@ ...@@ -3296,7 +3296,6 @@
info_field_list.push(selection[i]); info_field_list.push(selection[i]);
} }
} }
} }
for (j = 0; j < info_field_list.length; j += 1) { for (j = 0; j < info_field_list.length; j += 1) {
...@@ -3304,8 +3303,10 @@ ...@@ -3304,8 +3303,10 @@
switch (info_field.getAttribute("data-info")) { switch (info_field.getAttribute("data-info")) {
case "records": case "records":
if (total !== undefined) { if (total !== undefined) {
zero_no_show = ((options.limit[0] || 0 === 0) && total !== 0) ? 1 : (options.limit[0] || 0); no_limit = options.limit[0] || 0;
min = Math.min(total, (zero_no_show + (options.limit[1] || 0))); no_items = options.limit[1] || 0;
zero_no_show = (no_limit === 0 && total !== 0) ? 1 : no_limit;
min = Math.min(total, (no_limit + no_items));
info = zero_no_show + "-" + min + "/" + total + " Records"; info = zero_no_show + "-" + min + "/" + total + " Records";
} }
break; break;
...@@ -3583,7 +3584,7 @@ ...@@ -3583,7 +3584,7 @@
init.timer = window.setTimeout(function () { init.timer = window.setTimeout(function () {
// update gadgets // update gadgets
init.setPageElements( init.setPageElements(
{}, [{"children": [{"id": action_dict.id}]}], false {}, [{"children": [{"id": config.id}]}], false
); );
init.timer = 0; init.timer = 0;
}, 500); }, 500);
...@@ -3883,7 +3884,7 @@ ...@@ -3883,7 +3884,7 @@
// update gadget // update gadget
init.setPageElements( init.setPageElements(
{}, [{"children": [{"id": action_dict.id}]}], false {}, [{"children": [{"id": config.id}]}], false
); );
} else { } else {
util.errorHandler({ util.errorHandler({
...@@ -3916,9 +3917,7 @@ ...@@ -3916,9 +3917,7 @@
.then(function (reply) { .then(function (reply) {
if (!page.querySelectorAll("div.ui-content")[0] if (!page.querySelectorAll("div.ui-content")[0]
.getAttribute("data-bound")) { .getAttribute("data-bound")) {
return init.setPageElements({ return init.setPageElements({"id": page.id}, reply, undefined);
"id": page.id
}, reply, undefined);
} }
}) })
.fail(util.errorHandler); .fail(util.errorHandler);
...@@ -4089,11 +4088,7 @@ ...@@ -4089,11 +4088,7 @@
init.fetchPageLayouts("settings", destination) init.fetchPageLayouts("settings", destination)
.then(function (reply) { .then(function (reply) {
return init.setPageElements( return init.setPageElements(config, reply, create);
config,
reply,
create
);
}) })
.then(init.setPageBindings) .then(init.setPageBindings)
.fail(util.errorHandler); .fail(util.errorHandler);
......
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