Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
f31e54b9
Commit
f31e54b9
authored
Apr 30, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: fix for Opera/oldIOS not supporting first/lastElementChild...
parent
b3413ed0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
js/erp5_loader.js
js/erp5_loader.js
+11
-4
No files found.
js/erp5_loader.js
View file @
f31e54b9
...
@@ -873,6 +873,8 @@
...
@@ -873,6 +873,8 @@
* @param {object} spec JSON configuration
* @param {object} spec JSON configuration
* @return {object} object including fragment, child-selector, placeholder
* @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
)
{
factory
.
widget
.
header
=
function
(
spec
)
{
var
container
,
id
,
target
,
set_img
,
img
;
var
container
,
id
,
target
,
set_img
,
img
;
...
@@ -882,11 +884,11 @@
...
@@ -882,11 +884,11 @@
img
=
spec
.
image
||
{};
img
=
spec
.
image
||
{};
// button group wrappers and title (inserted before last wrapper!)
// button group wrappers and title (inserted before last wrapper!)
target
=
function
(
spec
)
{
target
=
function
(
new_
spec
)
{
var
position
,
drop_content
,
fragment
,
count
,
config
;
var
position
,
drop_content
,
fragment
,
count
,
config
;
count
=
spec
.
j
;
count
=
new_
spec
.
j
;
config
=
spec
.
config
;
config
=
new_
spec
.
config
;
fragment
=
document
.
createDocumentFragment
();
fragment
=
document
.
createDocumentFragment
();
position
=
(
config
.
section_list
||
[
"
first
"
,
"
last
"
])[
count
];
position
=
(
config
.
section_list
||
[
"
first
"
,
"
last
"
])[
count
];
drop_content
=
config
.
add_content
===
0
?
0
:
1
;
drop_content
=
config
.
add_content
===
0
?
0
:
1
;
...
@@ -949,9 +951,10 @@
...
@@ -949,9 +951,10 @@
return
{
return
{
"
fragment
"
:
container
,
"
fragment
"
:
container
,
"
child_selector
"
:
container
.
querySelector
(
"
#
"
+
id
),
"
child_selector
"
:
container
.
querySelector
(
"
#
"
+
id
)
||
container
,
"
target
"
:
target
,
"
target
"
:
target
,
"
target_selector
"
:
"
last
"
,
"
target_selector
"
:
"
last
"
,
// TODO: remove this...
"
spec
"
:
{
"
spec
"
:
{
"
img
"
:
!!
set_img
,
"
img
"
:
!!
set_img
,
"
src
"
:
img
.
src
,
"
src
"
:
img
.
src
,
...
@@ -6696,8 +6699,12 @@
...
@@ -6696,8 +6699,12 @@
// NOTE: wrapper_selector will return a fragment (set to
// NOTE: wrapper_selector will return a fragment (set to
// first/last-ElementChild or a DOM node
// 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
=
done_target
=
wrapper_selector
[
wrapper
.
target_selector
+
"
ElementChild
"
]
wrapper_selector
[
wrapper
.
target_selector
+
"
ElementChild
"
]
||
wrapper_selector
[
wrapper
.
target_selector
+
"
Child
"
]
||
wrapper_selector
;
||
wrapper_selector
;
done_target
.
appendChild
(
response
);
done_target
.
appendChild
(
response
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment