Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « header_search « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d7e21f55ea5f6416f984313ff70fbbeb28887e29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import HeaderSearchApp from './components/app.vue';
import createStore from './store';

Vue.use(Translate);

export const initHeaderSearchApp = () => {
  const el = document.getElementById('js-header-search');

  if (!el) {
    return false;
  }

  const { searchPath, issuesPath, mrPath, autocompletePath } = el.dataset;
  let { searchContext } = el.dataset;
  searchContext = JSON.parse(searchContext);

  return new Vue({
    el,
    store: createStore({ searchPath, issuesPath, mrPath, autocompletePath, searchContext }),
    render(createElement) {
      return createElement(HeaderSearchApp);
    },
  });
};