Commit f31e54b9 authored by Sven Franck's avatar Sven Franck

app: fix for Opera/oldIOS not supporting first/lastElementChild...

parent b3413ed0
......@@ -873,6 +873,8 @@
* @param {object} spec JSON configuration
* @return {object} object including fragment, child-selector, placeholder
*/
// TODO: too complicated and too much custom stuff passed back
// This cannot be so difficult...
factory.widget.header = function (spec) {
var container, id, target, set_img, img;
......@@ -882,11 +884,11 @@
img = spec.image || {};
// button group wrappers and title (inserted before last wrapper!)
target = function (spec) {
target = function (new_spec) {
var position, drop_content, fragment, count, config;
count = spec.j;
config = spec.config;
count = new_spec.j;
config = new_spec.config;
fragment = document.createDocumentFragment();
position = (config.section_list || ["first", "last"])[count];
drop_content = config.add_content === 0 ? 0 : 1;
......@@ -949,9 +951,10 @@
return {
"fragment": container,
"child_selector": container.querySelector("#" + id),
"child_selector": container.querySelector("#" + id) || container,
"target": target,
"target_selector": "last",
// TODO: remove this...
"spec": {
"img": !!set_img,
"src": img.src,
......@@ -6696,8 +6699,12 @@
// NOTE: wrapper_selector will return a fragment (set to
// first/last-ElementChild or a DOM node
// NOTE: Opera/old IOS do not support first/lastELEMENTChild...
// must use first/lastChild instead
// TODO: can this be .... removed?
done_target =
wrapper_selector[wrapper.target_selector + "ElementChild"]
|| wrapper_selector[wrapper.target_selector + "Child"]
|| wrapper_selector;
done_target.appendChild(response);
}
......
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