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
0e3f1f2f
Commit
0e3f1f2f
authored
Apr 18, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: add data-widget/map to HTML output as hint on updates
parent
562301c6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
js/erp5_loader.js
js/erp5_loader.js
+20
-15
No files found.
js/erp5_loader.js
View file @
0e3f1f2f
...
@@ -1827,6 +1827,7 @@
...
@@ -1827,6 +1827,7 @@
*/
*/
// TODO: add collapsible support if needed
// TODO: add collapsible support if needed
// TODO: dividers? will not be in spec, so can only be listview option!
// TODO: dividers? will not be in spec, so can only be listview option!
// TODO: find better way to set mapper/widget
factory
.
widget
.
listview
=
function
(
spec
)
{
factory
.
widget
.
listview
=
function
(
spec
)
{
var
fragment
,
has_filter
,
generator
;
var
fragment
,
has_filter
,
generator
;
...
@@ -1937,18 +1938,22 @@
...
@@ -1937,18 +1938,22 @@
(
spec
.
inset
?
(
spec
.
inset
?
"
ui-listview-inset ui-corner-all ui-shadow
"
:
""
)
"
ui-listview-inset ui-corner-all ui-shadow
"
:
""
)
},
},
"
attributes
"
:
{
"
data-role
"
:
"
listview
"
,
"
data-enhanced
"
:
true
},
"
attributes
"
:
{
"
data-role
"
:
"
listview
"
,
"
data-enhanced
"
:
true
,
// NOTE: on updates, we need wrapper with generator and mapper???
"
data-widget
"
:
"
listview
"
},
"
logic
"
:
{
"
logic
"
:
{
"
id
"
:
spec
.
id
||
null
,
"
id
"
:
spec
.
id
||
null
,
"
data-update
"
:
spec
.
dynamic
?
true
:
null
,
"
data-update
"
:
spec
.
dynamic
?
true
:
null
,
// NOTE: on updates, we need wrapper with generator...
"
data-widget
"
:
"
listview
"
,
"
data-reference
"
:
spec
.
reference
||
null
,
"
data-reference
"
:
spec
.
reference
||
null
,
"
data-filter
"
:
spec
.
filter
||
null
,
"
data-filter
"
:
spec
.
filter
||
null
,
"
data-input
"
:
spec
.
input
||
null
,
"
data-input
"
:
spec
.
input
||
null
,
"
data-filter-theme
"
:
spec
.
filter_theme
||
null
,
"
data-filter-theme
"
:
spec
.
filter_theme
||
null
,
"
data-filter-placeholder
"
:
spec
.
placeholder
||
null
,
"
data-filter-placeholder
"
:
spec
.
placeholder
||
null
,
"
data-divider-theme
"
:
spec
.
divider_theme
||
null
"
data-divider-theme
"
:
spec
.
divider_theme
||
null
,
"
data-map
"
:
spec
.
map_children
||
null
}
}
}));
}));
}
}
...
@@ -2297,7 +2302,8 @@
...
@@ -2297,7 +2302,8 @@
"
attributes
"
:
{
"
attributes
"
:
{
"
data-update
"
:
"
true
"
,
"
data-update
"
:
"
true
"
,
"
data-widget
"
:
"
table
"
"
data-widget
"
:
"
table
"
}
},
"
logic
"
:
{
"
data-map
"
:
spec
.
map_children
||
null
}
}));
}));
break
;
break
;
}
}
...
@@ -4639,10 +4645,8 @@
...
@@ -4639,10 +4645,8 @@
{
{
"
portal_type_source
"
:
config
.
state
.
type
,
"
portal_type_source
"
:
config
.
state
.
type
,
"
portal_type_title
"
:
config
.
state
.
title
,
"
portal_type_title
"
:
config
.
state
.
title
,
"
property_dict
"
:
util
.
mergeObject
({
"
property_dict
"
:
util
.
mergeObject
(
"
dynamic
"
:
true
,
{
"
dynamic
"
:
true
},
"
map_children
"
:
config
.
state
.
dyno_dict
.
map_children
},
config
.
state
.
dyno_dict
),
config
.
state
.
dyno_dict
),
"
scheme
"
:
config
.
state
.
scheme
"
scheme
"
:
config
.
state
.
scheme
},
},
...
@@ -4893,10 +4897,8 @@
...
@@ -4893,10 +4897,8 @@
{
{
"
portal_type_source
"
:
config
.
state
.
type
,
"
portal_type_source
"
:
config
.
state
.
type
,
"
portal_type_title
"
:
config
.
state
.
title
,
"
portal_type_title
"
:
config
.
state
.
title
,
"
property_dict
"
:
util
.
mergeObject
({
"
property_dict
"
:
util
.
mergeObject
(
"
dynamic
"
:
true
,
{
"
dynamic
"
:
true
},
"
map_children
"
:
config
.
state
.
dyno_dict
.
map_children
},
config
.
state
.
dyno_dict
),
config
.
state
.
dyno_dict
),
"
scheme
"
:
config
.
state
.
scheme
"
scheme
"
:
config
.
state
.
scheme
},
},
...
@@ -6313,12 +6315,14 @@
...
@@ -6313,12 +6315,14 @@
}
}
}
}
}
else
{
}
else
{
// TODO: can this be done without storing on and querying DOM???
widget
=
pass
.
state
.
gadget
.
querySelector
(
"
[data-update]
"
)
widget
=
pass
.
state
.
gadget
.
querySelector
(
"
[data-update]
"
)
.
getAttribute
(
"
data-widget
"
);
wrapper
.
property_dict
.
map_children
=
widget
.
getAttribute
(
"
data-map
"
);
wrapper
=
util
.
mergeObject
(
wrapper
=
util
.
mergeObject
(
factory
.
widget
[
widget
](
wrapper
.
property_dict
),
factory
.
widget
[
widget
.
getAttribute
(
"
data-widget
"
)
](
wrapper
.
property_dict
),
wrapper
wrapper
);
);
// add scheme and field_dict to list
// add scheme and field_dict to list
kids
=
util
.
inherit
(
kids
=
util
.
inherit
(
pointer_results
.
data
.
rows
,
pointer_results
.
data
.
rows
,
...
@@ -6437,6 +6441,7 @@
...
@@ -6437,6 +6441,7 @@
for
(
k
=
0
,
l
=
response_list
.
length
;
k
<
l
;
k
+=
1
)
{
for
(
k
=
0
,
l
=
response_list
.
length
;
k
<
l
;
k
+=
1
)
{
response
=
response_list
[
k
];
response
=
response_list
[
k
];
done_target
=
undefined
;
done_target
=
undefined
;
if
(
response
)
{
if
(
response
)
{
// generate target for and append response
// generate target for and append response
// NOTE: wrapper.spec is used for header only.
// NOTE: wrapper.spec is used for header only.
...
...
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