Mobile Method Is Now Handled By JS
This commit is contained in:
parent
0f1bbec798
commit
49b63baeb8
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"/js/velocity.js": "/js/velocity.js?id=0f1494c8d6bed9b5ef13",
|
||||
"/js/velocity-core.js": "/js/velocity-core.js?id=eb4a47e5794e70bd4353",
|
||||
"/js/velocity-core.js": "/js/velocity-core.js?id=cd3390dd556a97cb8431",
|
||||
"/css/velocity-admin.css": "/css/velocity-admin.css?id=4322502d80a0e4a0affd",
|
||||
"/css/velocity.css": "/css/velocity.css?id=29a0849a44b50cc36048"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,17 @@ window.showAlert = (messageType, messageLabel, message) => {
|
|||
/**
|
||||
* Helper functions.
|
||||
*/
|
||||
function isMobile() {
|
||||
if (
|
||||
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i |
|
||||
/mobi/i.test(navigator.userAgent)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function loadDynamicScript(src, onScriptLoaded) {
|
||||
let dynamicScript = document.createElement('script');
|
||||
|
||||
|
|
@ -76,8 +87,9 @@ $(function() {
|
|||
let velocityJSPath = 'themes/velocity/assets/js/velocity.js';
|
||||
|
||||
if (
|
||||
isMobile() &&
|
||||
removeTrailingSlash(baseUrl) ===
|
||||
removeTrailingSlash(window.location.href)
|
||||
removeTrailingSlash(window.location.href)
|
||||
) {
|
||||
/**
|
||||
* Event for mobile to check the user interaction for homepage.
|
||||
|
|
|
|||
|
|
@ -3,13 +3,6 @@
|
|||
src="{{ asset('themes/velocity/assets/js/velocity-core.js') }}">
|
||||
</script>
|
||||
|
||||
@if (! $velocityHelper->isMobile())
|
||||
<script
|
||||
type="text/javascript"
|
||||
src="{{ asset('themes/velocity/assets/js/velocity.js') }}">
|
||||
</script>
|
||||
@endif
|
||||
|
||||
<script type="text/javascript">
|
||||
(() => {
|
||||
/* activate session messages */
|
||||
|
|
|
|||
Loading…
Reference in New Issue