diff options
Diffstat (limited to 'web_src/js/components')
-rw-r--r-- | web_src/js/components/DashboardRepoList.js | 4 | ||||
-rw-r--r-- | web_src/js/components/RepoActivityTopAuthors.vue | 5 | ||||
-rw-r--r-- | web_src/js/components/RepoBranchTagDropdown.js | 7 | ||||
-rw-r--r-- | web_src/js/components/VueComponentLoader.js | 11 |
4 files changed, 10 insertions, 17 deletions
diff --git a/web_src/js/components/DashboardRepoList.js b/web_src/js/components/DashboardRepoList.js index 7ae62af0a0..04eb304c80 100644 --- a/web_src/js/components/DashboardRepoList.js +++ b/web_src/js/components/DashboardRepoList.js @@ -348,7 +348,7 @@ function initVueComponents() { } -function initDashboardRepoList() { +export function initDashboardRepoList() { const el = document.getElementById('dashboard-repo-list'); const dashboardRepoListData = pageData.dashboardRepoList || null; if (!el || !dashboardRepoListData) return; @@ -366,5 +366,3 @@ function initDashboardRepoList() { }, }); } - -export {initDashboardRepoList}; diff --git a/web_src/js/components/RepoActivityTopAuthors.vue b/web_src/js/components/RepoActivityTopAuthors.vue index d510695b1d..37b6df9187 100644 --- a/web_src/js/components/RepoActivityTopAuthors.vue +++ b/web_src/js/components/RepoActivityTopAuthors.vue @@ -101,10 +101,9 @@ const sfc = { } }; -function initRepoActivityTopAuthorsChart() { +export function initRepoActivityTopAuthorsChart() { initVueApp('#repo-activity-top-authors-chart', sfc); } -export default sfc; -export {initRepoActivityTopAuthorsChart}; +export default sfc; // this line is necessary to activate the IDE's Vue plugin </script> diff --git a/web_src/js/components/RepoBranchTagDropdown.js b/web_src/js/components/RepoBranchTagDropdown.js index a0be57ab3d..50c71d5bac 100644 --- a/web_src/js/components/RepoBranchTagDropdown.js +++ b/web_src/js/components/RepoBranchTagDropdown.js @@ -1,6 +1,7 @@ import Vue from 'vue'; +import {vueDelimiters} from './VueComponentLoader.js'; -function initRepoBranchTagDropdown(selector) { +export function initRepoBranchTagDropdown(selector) { $(selector).each(function () { const $dropdown = $(this); const $data = $dropdown.find('.data'); @@ -26,7 +27,7 @@ function initRepoBranchTagDropdown(selector) { $data.remove(); new Vue({ el: this, - delimiters: ['${', '}'], + delimiters: vueDelimiters, data, computed: { filteredItems() { @@ -157,5 +158,3 @@ function initRepoBranchTagDropdown(selector) { }); }); } - -export {initRepoBranchTagDropdown}; diff --git a/web_src/js/components/VueComponentLoader.js b/web_src/js/components/VueComponentLoader.js index 6b2a2cbd58..110782bbb1 100644 --- a/web_src/js/components/VueComponentLoader.js +++ b/web_src/js/components/VueComponentLoader.js @@ -1,10 +1,10 @@ import Vue from 'vue'; import {svgs} from '../svg.js'; -const vueDelimiters = ['${', '}']; +export const vueDelimiters = ['${', '}']; let vueEnvInited = false; -function initVueEnv() { +export function initVueEnv() { if (vueEnvInited) return; vueEnvInited = true; @@ -14,7 +14,7 @@ function initVueEnv() { } let vueSvgInited = false; -function initVueSvg() { +export function initVueSvg() { if (vueSvgInited) return; vueSvgInited = true; @@ -36,8 +36,7 @@ function initVueSvg() { } } - -function initVueApp(el, opts = {}) { +export function initVueApp(el, opts = {}) { if (typeof el === 'string') { el = document.querySelector(el); } @@ -48,5 +47,3 @@ function initVueApp(el, opts = {}) { delimiters: vueDelimiters, }, opts)); } - -export {vueDelimiters, initVueEnv, initVueSvg, initVueApp}; |