2022-09-12 18:06:24 +00:00
|
|
|
// This file is automatically compiled by Webpack, along with any other files
|
|
|
|
// present in this directory. You're encouraged to place your actual application logic in
|
|
|
|
// a relevant structure within app/javascript and only use these pack files to reference
|
|
|
|
// that code so that it will be compiled.
|
|
|
|
|
2022-10-20 00:09:32 +00:00
|
|
|
import Vue from 'vue';
|
2022-09-12 18:06:24 +00:00
|
|
|
import Rails from '@rails/ujs';
|
|
|
|
import Turbolinks from 'turbolinks';
|
2022-10-20 00:09:32 +00:00
|
|
|
import PublicArticleSearch from '../portal/components/PublicArticleSearch.vue';
|
2022-09-12 18:06:24 +00:00
|
|
|
|
|
|
|
import { navigateToLocalePage } from '../portal/portalHelpers';
|
|
|
|
|
|
|
|
import '../portal/application.scss';
|
|
|
|
|
|
|
|
Rails.start();
|
|
|
|
Turbolinks.start();
|
|
|
|
|
2022-10-20 00:09:32 +00:00
|
|
|
const initPageSetUp = () => {
|
|
|
|
navigateToLocalePage();
|
|
|
|
const isSearchContainerAvailable = document.querySelector('#search-wrap');
|
|
|
|
if (isSearchContainerAvailable) {
|
|
|
|
new Vue({
|
|
|
|
components: { PublicArticleSearch },
|
|
|
|
template: '<PublicArticleSearch />',
|
|
|
|
}).$mount('#search-wrap');
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
initPageSetUp();
|
|
|
|
});
|
|
|
|
|
|
|
|
document.addEventListener('turbolinks:load', () => {
|
|
|
|
initPageSetUp();
|
|
|
|
});
|