Commit 43b37318 authored by Sven Franck's avatar Sven Franck

added in-page panel for Cedric

parent 86d59f3f
......@@ -15,8 +15,21 @@
"generate": "gadget",
"type": "listbox",
"href": "person_overview"
}
],
},{
"generate": "widget",
"type": "panel",
"id": "cedric",
"theme": "slapos-white",
"property_dict": {
"close": null
},
"children": [{
"type": "p",
"direct": {},
"attributes": {},
"logic": {"text": "Hello Cedric"}
}]
}],
"new": [
{
"generate": "gadget",
......
......@@ -3330,8 +3330,8 @@
// add to DOM if scoped
if (url_dict.data_url) {
util.getPanel(url_dict.data_url).appendChild(panel);
return undefined;
//util.getPanel(url_dict.data_url).appendChild(panel);
return panel;
} else {
document.body.insertBefore(panel, document.body.children[0]);
}
......@@ -4281,7 +4281,7 @@
// NOTE: we are defaulting to fixed JQM toolbars! layout
factory.page = function (content_dict, url_dict, create) {
var i, j, last, wrapper, split_url, promises = [], container, target,
view, render, encoded;
view, render, encoded, temp;
container = util.getPage(url_dict.data_url);
view = (url_dict && url_dict.mode) ? url_dict.mode : "default";
......@@ -4308,7 +4308,11 @@
util.error("page: Element not found");
util.loader("", "status_dict.not_found", "ban-circle");
}
target.appendChild(promises[j]);
if (util.testForString("panel", promises[j].className)) {
temp = promises[j];
} else {
target.appendChild(promises[j]);
}
}
// page does not exist
......@@ -4366,6 +4370,12 @@
}
}
// add panel
if (temp) {
container.appendChild(temp);
$(temp).panel();
}
// update header before changing to a new page/or back to home
if (create !== false) {
app.setPageTitle(
......
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