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
a3968df2
Commit
a3968df2
authored
Apr 30, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: allow passing class_list and position on dynamic controlgroups
parent
0ec7b1bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
js/erp5_loader.js
js/erp5_loader.js
+19
-4
No files found.
js/erp5_loader.js
View file @
a3968df2
...
...
@@ -1011,6 +1011,7 @@
element
.
text
=
element
.
center
[
0
].
title
;
element
.
text_i18n
=
element
.
center
[
0
].
title_i18n
;
}
// TODO: also no!
element
.
iconpos
=
"
right
"
;
return
{
"
type
"
:
"
item
"
,
...
...
@@ -1885,6 +1886,7 @@
if
(
static_item
||
divider
)
{
target
=
document
.
createDocumentFragment
();
}
else
{
// TODO: wtf is this for?
element
.
is_main
=
true
;
target
=
factory
.
util
.
generateContentElement
(
"
link
"
,
...
...
@@ -2500,6 +2502,7 @@
// main link, split button
// TODO: make icon generic! what about util.class_string
// TODO: why using is_main????
case
"
link
"
:
is_main
=
!!
spec
.
is_main
;
no_icon
=
config
.
icon
===
null
;
...
...
@@ -2507,11 +2510,12 @@
"
type
"
:
"
a
"
,
"
direct
"
:
{
"
href
"
:
spec
.
href
||
"
#
"
,
"
className
"
:
"
ui-btn
"
+
"
ui-btn-
"
+
"
className
"
:
spec
.
class_list
+
"
ui-btn
"
+
"
ui-btn-
"
+
(
config
.
split_theme
||
config
.
theme
||
"
inherit
"
)
+
(
no_icon
?
"
"
:
(
is_main
?
"
ui-btn-icon-right
"
:
"
ui-btn-icon-
"
+
(
spec
.
iconpos
||
"
notext
"
))
+
"
ui-icon-
"
+
(
config
.
icon
||
spec
.
icon
||
"
carat-r
"
))
"
ui-icon-
"
+
(
config
.
icon
||
spec
.
icon
||
(
is_main
===
false
?
"
carat-d
"
:
"
carat-r
"
)))
},
"
attributes
"
:
{
"
title
"
:
spec
.
title
||
""
,
...
...
@@ -3510,7 +3514,7 @@
/* Mapper list item */
/* ********************************************************************** */
/**
* Map records to factory widget listview
and carousel
* Map records to factory widget listview
, carousel and controlgroup
* @method listItem
* @param {object} spec Object containing element, parent and counter
* @return {object} mapped object
...
...
@@ -3521,7 +3525,8 @@
// NOTE: make sure there is no "id" flying through here!!! only _id
map
.
listItem
=
function
(
spec
)
{
var
quirk_dict
,
section
,
label
,
j
,
k
,
field
,
setter
,
record
,
new_item
,
id
,
key
,
translation_fields
,
item
,
relation
,
promise_list
,
pass
,
count
;
id
,
key
,
translation_fields
,
item
,
relation
,
promise_list
,
pass
,
count
,
class_string
;
promise_list
=
[];
translation_fields
=
"
titletextlabel
"
;
...
...
@@ -3556,6 +3561,15 @@
new_item
.
id
=
id
;
}
// first/last
// TODO: don't do this here and elsewhere and elsewhere...
if
(
spec
.
count
===
0
)
{
class_string
=
"
ui-first-child
"
;
}
if
(
spec
.
count
===
spec
.
wrapper
.
property_dict
.
length
-
1
)
{
class_string
=
"
ui-last-child
"
;
}
// loop scheme sections
for
(
j
=
0
;
j
<
item
.
scheme
.
length
;
j
+=
1
)
{
section
=
item
.
scheme
[
j
];
...
...
@@ -3596,6 +3610,7 @@
pos
=
response
.
position
;
obj
=
{};
new_item
[
pos
]
=
new_item
[
pos
]
||
[];
new_item
.
class_list
=
class_string
||
""
;
// text/label/... all stuff translateable
if
(
response
.
text_element
)
{
...
...
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