Commit 6295d0e4 authored by Sven Franck's avatar Sven Franck

only query JIO if a page requires a portal_type to be queried

parent 354997b6
...@@ -338,7 +338,6 @@ ...@@ -338,7 +338,6 @@
} }
// TODO: Make generic handler for this // TODO: Make generic handler for this
if (item[property] === "") { if (item[property] === "") {
console.log("ribbon")
obj.ribbon = true; obj.ribbon = true;
} }
if ((split.length > 1 && window.location.host !== host) || if ((split.length > 1 && window.location.host !== host) ||
...@@ -1759,7 +1758,6 @@ ...@@ -1759,7 +1758,6 @@
} }
); );
if (props.ribbon) { if (props.ribbon) {
console.log("ribbon");
ribbon_wrap = factory.generateElement( ribbon_wrap = factory.generateElement(
"span", "span",
{"className":"ribbon-wrapper"} {"className":"ribbon-wrapper"}
...@@ -3837,6 +3835,9 @@ ...@@ -3837,6 +3835,9 @@
// add validation to all forms // add validation to all forms
for (j = 0; j < form_list.length; j += 1) { for (j = 0; j < form_list.length; j += 1) {
form_element = form_list[j]; form_element = form_list[j];
// console.log("foo, we have a form")
//
// console.log(form_element);
if (form_element.getAttribute("data-bound") === null) { if (form_element.getAttribute("data-bound") === null) {
form_element.setAttribute("data-bound", true); form_element.setAttribute("data-bound", true);
...@@ -3995,7 +3996,8 @@ ...@@ -3995,7 +3996,8 @@
if (reply.response) { if (reply.response) {
baggage.fields = util.parseIfNeeded(reply.response); baggage.fields = util.parseIfNeeded(reply.response);
} }
if (baggage.create !== false) {
if (baggage.create !== false && baggage.config.initial_query) {
return init.testForSampleData({ return init.testForSampleData({
"storage": "items", "storage": "items",
"type": baggage.type, "type": baggage.type,
...@@ -4070,11 +4072,13 @@ ...@@ -4070,11 +4072,13 @@
} else { } else {
baggage.state = {}; baggage.state = {};
baggage.state.method = baggage.constructor; baggage.state.method = baggage.constructor;
baggage.state.query = init.generateQueryObject({}, baggage.type); if (baggage.config.initial_query) {
baggage.state.query = init.generateQueryObject({}, baggage.type);
}
} }
// skip total for single item layouts! // skip total for single item layouts!
// TODO: What if the first page should only contain an object? // TODO: What if the first page should only contain an object?
if (baggage.layout_level === 0) { if (baggage.layout_level === 0 && baggage.config.initial_query) {
return util.fetchData({ return util.fetchData({
"baggage": baggage, "baggage": baggage,
"storage": "items", "storage": "items",
...@@ -4116,7 +4120,7 @@ ...@@ -4116,7 +4120,7 @@
); );
} }
// new item, no query! // new item, no query!
if (baggage.mode) { if (baggage.mode || baggage.config.initial_query === undefined) {
return { return {
"baggage": baggage "baggage": baggage
}; };
......
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