debian-mirror-gitlab/app/assets/javascripts/search/index.js

15 lines
525 B
JavaScript
Raw Normal View History

2021-01-03 14:25:43 +05:30
import { queryToObject } from '~/lib/utils/url_utility';
import createStore from './store';
2021-02-22 17:27:13 +05:30
import { initTopbar } from './topbar';
2021-01-29 00:20:46 +05:30
import { initSidebar } from './sidebar';
2021-01-03 14:25:43 +05:30
2021-01-29 00:20:46 +05:30
export const initSearchApp = () => {
// Similar to url_utility.decodeUrlParameter
// Our query treats + as %20. This replaces the query + symbols with %20.
const sanitizedSearch = window.location.search.replace(/\+/g, '%20');
const store = createStore({ query: queryToObject(sanitizedSearch) });
2021-01-03 14:25:43 +05:30
2021-02-22 17:27:13 +05:30
initTopbar(store);
2021-01-29 00:20:46 +05:30
initSidebar(store);
2021-01-03 14:25:43 +05:30
};