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
d1c8b6cc
Commit
d1c8b6cc
authored
Apr 30, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: set sample_flag_dict to not waste queries to re-check for samples
parent
124f5b24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
js/erp5_loader.js
js/erp5_loader.js
+10
-1
No files found.
js/erp5_loader.js
View file @
d1c8b6cc
...
...
@@ -4758,6 +4758,11 @@
*/
app
=
{};
/**
* Dict to prevent loading samples of multiple portal_types
*/
app
.
sample_dict
=
{};
/**
* Fallback for undefined arrays (faster to lookup than to create)
*/
...
...
@@ -6146,7 +6151,8 @@
pass
.
data_dict
.
field_dict
=
util
.
parse
(
reply
.
response
);
// try to get 1 record for this portal_type
if
(
app
.
storage_dict
.
property_dict
.
allow_sample_data
&&
pass
.
grant
&&
if
(
!
app
.
sample_dict
[
pass
.
config_dict
.
portal_type_source
]
&&
app
.
storage_dict
.
property_dict
.
allow_sample_data
&&
pass
.
grant
&&
(
pass
.
create
!==
false
)
&&
pass
.
config_dict
.
initial_query
)
{
return
storage
.
fetch
({
"
pass
"
:
pass
,
...
...
@@ -6183,6 +6189,9 @@
.
then
(
function
(
e
)
{
var
response
,
i
,
len
,
promise_list
,
record
;
// set flag to prevent testing for this portal_type again
// (saves a query)
app
.
sample_dict
[
pass
.
config_dict
.
portal_type_source
]
=
true
;
response
=
util
.
parse
(
e
.
target
.
responseText
);
len
=
response
.
length
;
promise_list
=
[];
...
...
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