diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-11 18:09:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-11 18:09:30 +0300 |
commit | ce4562ad642c2c2b504dc322d9c7a1fdbf30cb83 (patch) | |
tree | 71f641fd95cab65ae14bd942c9b5dfda13f090f2 /app/assets/javascripts/run_modules.js | |
parent | 29549d052d62b949830873f76b6c77d97cbd533d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/run_modules.js')
-rw-r--r-- | app/assets/javascripts/run_modules.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/run_modules.js b/app/assets/javascripts/run_modules.js new file mode 100644 index 00000000000..fabdff9bb76 --- /dev/null +++ b/app/assets/javascripts/run_modules.js @@ -0,0 +1,9 @@ +export const runModules = (modules, prefix) => { + document + .querySelector('meta[name="controller-path"]') + .content.split('/') + .forEach((part, index, arr) => { + const path = `${prefix}${[...arr.slice(0, index), part].join('/')}/index.js`; + modules[path]?.(); + }); +}; |