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
eeb26a2f
Commit
eeb26a2f
authored
11 years ago
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added portal_type to query for total number of records
parent
f428d904
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
js/erp5_loader.js
js/erp5_loader.js
+16
-6
No files found.
js/erp5_loader.js
View file @
eeb26a2f
...
...
@@ -2023,15 +2023,20 @@
if
(
config
.
columns
&&
config
.
columns
.
length
>
0
)
{
obj
.
select_list
=
config
.
columns
;
}
if
(
config
.
limit
)
{
obj
.
start
=
config
.
limit
[
0
];
obj
.
items
=
config
.
limit
[
1
];
}
if
(
item
)
{
obj
.
query
+=
'
AND (id:"%
'
+
item
+
'
")
'
;
obj
.
start
=
0
;
obj
.
items
=
1
;
}
if
(
obj
.
start
!==
undefined
)
{
obj
.
limit
=
[
obj
.
start
,
obj
.
items
];
}
else
{
obj
.
start
=
config
.
limit
[
0
];
obj
.
items
=
config
.
limit
[
1
];
obj
.
limit
=
[];
}
obj
.
limit
=
[
obj
.
start
,
obj
.
items
];
if
(
config
.
wildcard
)
{
obj
.
wildcard_character
=
config
.
wildcard
}
else
{
...
...
@@ -2571,6 +2576,7 @@
// generate content
// NOTE: this may include local header/footer/panel/popups
// TODO: beware of target when adding the above! should not be content
// TODO: bundle into a single DOM operation!
for
(
i
=
0
;
i
<
gadgets
.
length
;
i
+=
1
)
{
gadget
=
gadgets
[
i
];
gadget_id
=
gadget
.
gadget
||
gadget
.
getAttribute
(
"
data-gadget-id
"
);
...
...
@@ -2612,8 +2618,12 @@
return
undefined
;
})
.
then
(
function
(
sample_data
)
{
if
(
sample_data
&&
typeof
sample_data
.
target
.
response
===
"
string
"
)
{
response
=
JSON
.
parse
(
sample_data
.
target
.
response
);
if
(
sample_data
)
{
if
(
typeof
sample_data
.
target
.
response
===
"
string
"
)
{
response
=
JSON
.
parse
(
sample_data
.
target
.
response
);
}
else
{
response
=
sample_data
.
target
.
response
;
}
return
init
.
storeSampleData
(
response
,
portal_type
,
"
items
"
);
}
return
undefined
;
...
...
@@ -2634,7 +2644,7 @@
gadget_type
=
gadget
.
type
||
gadget
.
getAttribute
(
"
data-gadget-type
"
);
constructor
=
gadget_type
;
query
=
{}
;
query
=
init
.
buildQuery
({},
portal_type
)
;
}
return
util
.
fetchData
(
"
items
"
,
query
);
})
...
...
This diff is collapsed.
Click to expand it.
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