Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
geolocation
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
geolocation
Commits
29501442
Commit
29501442
authored
4 days ago
by
Christian Adamski
Browse files
Options
Downloads
Patches
Plain Diff
#3507996
Load feature scripts before initializing map
parent
7caf94ae
No related branches found
No related tags found
1 merge request
!90
#3507996 Load feature scripts before initializing map
Pipeline
#443957
failed
4 days ago
Stage: build
Stage: validate
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/MapProvider/GeolocationMapBase.js
+12
-10
12 additions, 10 deletions
js/MapProvider/GeolocationMapBase.js
with
12 additions
and
10 deletions
js/MapProvider/GeolocationMapBase.js
+
12
−
10
View file @
29501442
...
...
@@ -107,6 +107,17 @@ export class GeolocationMapBase {
.
then
(()
=>
{
return
Promise
.
all
(
stylesheetLoads
);
})
.
then
(()
=>
{
// Some features depend on libraries loaded AFTER main script but BEFORE instantiating.
const
featureScriptLoads
=
[];
Object
.
keys
(
this
.
settings
.
features
??
{}).
forEach
((
featureName
)
=>
{
const
featureScripts
=
this
.
settings
.
features
[
featureName
]?.
scripts
||
[];
featureScripts
.
forEach
((
featureScript
)
=>
{
featureScriptLoads
.
push
(
Drupal
.
geolocation
.
addScript
(
featureScript
));
});
});
return
Promise
.
all
(
featureScriptLoads
);
})
.
then
(()
=>
{
return
this
;
});
...
...
@@ -123,12 +134,6 @@ export class GeolocationMapBase {
return
null
;
}
const
scripts
=
featureSettings
.
scripts
||
[];
const
scriptLoads
=
[];
scripts
.
forEach
((
script
)
=>
{
scriptLoads
.
push
(
Drupal
.
geolocation
.
addScript
(
script
));
});
const
asyncScripts
=
featureSettings
.
async_scripts
||
[];
const
asyncScriptLoads
=
[];
asyncScripts
.
forEach
((
script
)
=>
{
...
...
@@ -141,10 +146,7 @@ export class GeolocationMapBase {
stylesheetLoads
.
push
(
Drupal
.
geolocation
.
addStylesheet
(
stylesheet
));
});
return
Promise
.
all
(
scriptLoads
)
.
then
(()
=>
{
return
Promise
.
all
(
asyncScriptLoads
);
})
return
Promise
.
all
(
asyncScriptLoads
)
.
then
(()
=>
{
return
Promise
.
all
(
stylesheetLoads
);
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment