WIP Reduce bs and jquery javascript
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
// Import dependencies
|
||||||
|
require('cookieconsent')
|
||||||
|
require('lazysizes')
|
||||||
|
require('lazysizes/plugins/unveilhooks/ls.unveilhooks')
|
||||||
|
require('picturefill')
|
||||||
|
require('leaflet')
|
||||||
|
|
||||||
// Enable resolution of stimulus controllers
|
// Enable resolution of stimulus controllers
|
||||||
import { Application } from 'stimulus'
|
import { Application } from 'stimulus'
|
||||||
import { definitionsFromContext } from 'stimulus/webpack-helpers'
|
import { definitionsFromContext } from 'stimulus/webpack-helpers'
|
||||||
@@ -65,12 +72,10 @@ import '@fancyapps/fancybox'
|
|||||||
|
|
||||||
global.$ = global.jQuery = $;
|
global.$ = global.jQuery = $;
|
||||||
|
|
||||||
require('cookieconsent');
|
require('bootstrap-sass/assets/javascripts/bootstrap/alert')
|
||||||
require('lazysizes');
|
require('bootstrap-sass/assets/javascripts/bootstrap/dropdown')
|
||||||
require('lazysizes/plugins/unveilhooks/ls.unveilhooks');
|
require('bootstrap-sass/assets/javascripts/bootstrap/modal')
|
||||||
require('bootstrap-sass/assets/javascripts/bootstrap');
|
require('bootstrap-sass/assets/javascripts/bootstrap/transition')
|
||||||
require('picturefill');
|
|
||||||
require('leaflet');
|
|
||||||
|
|
||||||
// Import components
|
// Import components
|
||||||
import EventBus from './_bus'
|
import EventBus from './_bus'
|
||||||
@@ -133,8 +138,7 @@ new Vue({
|
|||||||
this.scroll(0);
|
this.scroll(0);
|
||||||
},
|
},
|
||||||
scrollTo (anchorId) {
|
scrollTo (anchorId) {
|
||||||
const top = $(anchorId).offset().top;
|
document.getElementById(anchorId).scrollIntoView({ behavior: 'smooth' })
|
||||||
this.scroll(top);
|
|
||||||
},
|
},
|
||||||
scroll (top) {
|
scroll (top) {
|
||||||
window.scrollTo({ top: top, behavior: 'smooth' })
|
window.scrollTo({ top: top, behavior: 'smooth' })
|
||||||
|
|||||||
+3
-19
@@ -1,29 +1,13 @@
|
|||||||
<template>
|
<template functional>
|
||||||
<div v-if="showButtons" class="hidden-xs conceptbtns">
|
<div v-if="Object.keys(props.concepts).length > 1" class="hidden-xs conceptbtns">
|
||||||
<a v-for="concept of concepts" @click.prevent="scrollTo('#concept-' + concept.uid)"
|
<a v-for="concept of props.concepts"
|
||||||
:href="'#concept-' + concept.uid"
|
:href="'#concept-' + concept.uid"
|
||||||
:class="'btn btn-warning ep-sidebar concept-' + concept.code"
|
:class="'btn btn-warning ep-sidebar concept-' + concept.code"
|
||||||
:title="concept.name">{{ concept.name }}</a>
|
:title="concept.name">{{ concept.name }}</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import EventBus from '../_bus'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: [ 'concepts' ],
|
props: [ 'concepts' ],
|
||||||
computed: {
|
|
||||||
showButtons () {
|
|
||||||
let buttonCount = 0;
|
|
||||||
for (let concept in this.concepts) {
|
|
||||||
buttonCount++;
|
|
||||||
}
|
|
||||||
return buttonCount > 1;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
scrollTo (anchorId) {
|
|
||||||
EventBus.$emit('scrollTo', anchorId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -164,10 +164,6 @@
|
|||||||
this.scrollToMain();
|
this.scrollToMain();
|
||||||
}
|
}
|
||||||
this.activeSection = section;
|
this.activeSection = section;
|
||||||
// 'Wake up' Slick slider after changing visibility
|
|
||||||
Vue.nextTick(() => {
|
|
||||||
$('.slider--content > .slider__items').slick('setPosition');
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
scrollToMain () {
|
scrollToMain () {
|
||||||
EventBus.$emit('scrollTo', '#main');
|
EventBus.$emit('scrollTo', '#main');
|
||||||
|
|||||||
@@ -3,3 +3,7 @@
|
|||||||
padding-bottom: 56.25%;
|
padding-bottom: 56.25%;
|
||||||
margin-bottom: 34px;
|
margin-bottom: 34px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-top, .leaflet-bottom {
|
||||||
|
z-index: 490 !important;
|
||||||
|
}
|
||||||
|
|||||||
+5
-10
@@ -6,20 +6,15 @@
|
|||||||
|
|
||||||
<f:section name="Main">
|
<f:section name="Main">
|
||||||
<f:if condition="{hotel}">
|
<f:if condition="{hotel}">
|
||||||
<f:render section="Map" arguments="{latitude: hotel.0.data.latitude, longitude: hotel.0.data.longitude, googleMapsApiKey: settings.googleMapsApiKey}"/>
|
<f:variable name="latitude" value="{hotel.0.data.latitude}"/>
|
||||||
|
<f:variable name="longitude" value="{hotel.0.data.longitude}"/>
|
||||||
</f:if>
|
</f:if>
|
||||||
<f:if condition="{region}">
|
<f:if condition="{region}">
|
||||||
<f:render section="Map" arguments="{latitude: region.0.data.latitude, longitude: region.0.data.longitude, googleMapsApiKey: settings.googleMapsApiKey}"/>
|
<f:variable name="latitude" value="{region.0.data.latitude}"/>
|
||||||
|
<f:variable name="longitude" value="{region.0.data.longitude}"/>
|
||||||
</f:if>
|
</f:if>
|
||||||
</f:section>
|
|
||||||
|
|
||||||
<f:section name="Map">
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<osm-map
|
<osm-map lat="{latitude}" lng="{longitude}" :zoom="17"></osm-map>
|
||||||
lat="{latitude}"
|
|
||||||
lng="{longitude}"
|
|
||||||
:zoom="17"
|
|
||||||
></osm-map>
|
|
||||||
</div>
|
</div>
|
||||||
</f:section>
|
</f:section>
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
|
|
||||||
<f:section name="Main">
|
<f:section name="Main">
|
||||||
<ep:container data="{data}">
|
<ep:container data="{data}">
|
||||||
<osm-map :markers="{markerData}" :zoom="17"></osm-map>
|
<div class="osm-map"
|
||||||
|
data-controller="osm-map"
|
||||||
|
data-osm-map-markers-value='{markerData -> f:format.raw()}'></div>
|
||||||
</ep:container>
|
</ep:container>
|
||||||
</f:section>
|
</f:section>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<f:layout name="Default"/>
|
<f:layout name="Default"/>
|
||||||
|
|
||||||
<f:section name="Main">
|
<f:section name="Main">
|
||||||
<div id="searchbar">
|
<div id="searchbar" v-cloak>
|
||||||
<search-bar
|
<search-bar
|
||||||
options-uri='<ep:uri.ajax controller="AjaxSearchbar" action="options" pageUid="{settings.defaultAjaxUid}" />'
|
options-uri='<ep:uri.ajax controller="AjaxSearchbar" action="options" pageUid="{settings.defaultAjaxUid}" />'
|
||||||
reset-uri='<ep:uri.ajax controller="AjaxSearchbar" action="reset" pageUid="{settings.defaultAjaxUid}" />'
|
reset-uri='<ep:uri.ajax controller="AjaxSearchbar" action="reset" pageUid="{settings.defaultAjaxUid}" />'
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<f:layout name="Default"/>
|
<f:layout name="Default"/>
|
||||||
|
|
||||||
<f:section name="Main">
|
<f:section name="Main">
|
||||||
<div id="ep-navbar-searchbox" class="searchbox hidden-lg" v-show="searchBoxVisible" v-cloak>
|
<div id="searchbox" class="searchbox hidden-lg" v-cloak>
|
||||||
<search-box
|
<search-box
|
||||||
options-uri='<ep:uri.ajax controller="AjaxSearchbar" action="options" pageUid="{settings.defaultAjaxUid}" />'
|
options-uri='<ep:uri.ajax controller="AjaxSearchbar" action="options" pageUid="{settings.defaultAjaxUid}" />'
|
||||||
reset-uri='<ep:uri.ajax controller="AjaxSearchbar" action="reset" pageUid="{settings.defaultAjaxUid}" />'
|
reset-uri='<ep:uri.ajax controller="AjaxSearchbar" action="reset" pageUid="{settings.defaultAjaxUid}" />'
|
||||||
|
|||||||
+8
-2
@@ -26,6 +26,12 @@ Encore
|
|||||||
js: 'js/[name].js',
|
js: 'js/[name].js',
|
||||||
css: 'css/[name].css',
|
css: 'css/[name].css',
|
||||||
})
|
})
|
||||||
|
.configureImageRule({
|
||||||
|
filename: 'images/[name][ext]',
|
||||||
|
})
|
||||||
|
.configureFontRule({
|
||||||
|
filename: 'fonts/[name][ext]',
|
||||||
|
})
|
||||||
.configureBabel(function (babelConfig) {
|
.configureBabel(function (babelConfig) {
|
||||||
babelConfig.plugins = [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-syntax-dynamic-import' ]
|
babelConfig.plugins = [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-syntax-dynamic-import' ]
|
||||||
})
|
})
|
||||||
@@ -65,10 +71,10 @@ Encore
|
|||||||
css: 'css/[name].css',
|
css: 'css/[name].css',
|
||||||
})
|
})
|
||||||
.configureImageRule({
|
.configureImageRule({
|
||||||
filename: 'images/[name].[ext]',
|
filename: 'images/[name][ext]',
|
||||||
})
|
})
|
||||||
.configureFontRule({
|
.configureFontRule({
|
||||||
filename: 'fonts/[name].[ext]',
|
filename: 'fonts/[name][ext]',
|
||||||
})
|
})
|
||||||
.configureBabel(function (babelConfig) {
|
.configureBabel(function (babelConfig) {
|
||||||
babelConfig.plugins = [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-syntax-dynamic-import' ]
|
babelConfig.plugins = [ '@babel/plugin-proposal-object-rest-spread', '@babel/plugin-syntax-dynamic-import' ]
|
||||||
|
|||||||
Reference in New Issue
Block a user