mirror of
https://github.com/a2nt/webpack-bootstrap-ui-kit.git
synced 2024-10-22 11:05:45 +02:00
IMPROVEMENT: Detect touch screen
This commit is contained in:
parent
b994d98685
commit
b4365f9b75
2
dist/js/app.js
vendored
2
dist/js/app.js
vendored
File diff suppressed because one or more lines are too long
2
dist/js/app.js.map
vendored
2
dist/js/app.js.map
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate",
|
||||
"version": "1.7.8",
|
||||
"version": "1.7.9",
|
||||
"author": "Tony Air <tony@twma.pro>",
|
||||
"license": "MIT",
|
||||
"description": "This UI Kit allows you to build Bootstrap 4 webapp with some extra UI features. It's easy to extend and easy to convert HTML templates to CMS templates.",
|
||||
|
@ -7,7 +7,7 @@ import $ from 'jquery';
|
||||
import Events from '../_events';
|
||||
import 'jquery-hoverintent/jquery.hoverIntent.js';
|
||||
|
||||
const HoverUI = ($ => {
|
||||
const HoverUI = (($) => {
|
||||
// Constants
|
||||
const W = window;
|
||||
const D = document;
|
||||
@ -36,8 +36,8 @@ const HoverUI = ($ => {
|
||||
$target = $target
|
||||
? $target
|
||||
: $parent
|
||||
? $parent.find('.dropdown-menu')
|
||||
: null;
|
||||
? $parent.find('.dropdown-menu')
|
||||
: null;
|
||||
|
||||
if (!$target || !$target.length) {
|
||||
console.warn(`${NAME}: Missing target for:`);
|
||||
@ -51,7 +51,7 @@ const HoverUI = ($ => {
|
||||
ui.$triger = $triger;
|
||||
|
||||
// integrate with dropdown-toggle
|
||||
$('[data-toggle="dropdown"]').on('click touch', e => {
|
||||
$('[data-toggle="dropdown"]').on('click touch', (e) => {
|
||||
ui.hide();
|
||||
});
|
||||
|
||||
@ -68,7 +68,7 @@ const HoverUI = ($ => {
|
||||
});
|
||||
}
|
||||
|
||||
$el.on('click touch', e => {
|
||||
$el.on('click touch', (e) => {
|
||||
if (
|
||||
!$el.data('allow-click') ||
|
||||
(W.IsTouchScreen && !$el.data('allow-touch-click'))
|
||||
@ -154,7 +154,7 @@ const HoverUI = ($ => {
|
||||
});
|
||||
|
||||
// rewrite 'bootstrap/js/dist/dropdown'
|
||||
$('[data-toggle="dropdown"]').on('click touch', e => {
|
||||
$('[data-toggle="dropdown"]').on('click touch', (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const $el = $(e.currentTarget);
|
||||
|
@ -15,7 +15,7 @@ import FormBasics from './_components/_ui.form.basics';
|
||||
import SmoothScroll from 'smooth-scroll';
|
||||
const smoothScroll = SmoothScroll();
|
||||
|
||||
const MainUI = ($ => {
|
||||
const MainUI = (($) => {
|
||||
// Constants
|
||||
const W = window;
|
||||
const D = document;
|
||||
@ -127,7 +127,7 @@ const MainUI = ($ => {
|
||||
};
|
||||
|
||||
let eventFired = false;
|
||||
const setTouchScreen = bool => {
|
||||
const setTouchScreen = (bool) => {
|
||||
if (W.IsTouchScreen === bool || eventFired) {
|
||||
return;
|
||||
}
|
||||
@ -216,7 +216,7 @@ const MainUI = ($ => {
|
||||
//
|
||||
|
||||
// scroll links
|
||||
$('.js-scrollTo').on('click', e => {
|
||||
$('.js-scrollTo').on('click', (e) => {
|
||||
e.preventDefault();
|
||||
const el = e.currentTarget;
|
||||
const $el = $(e.currentTarget);
|
||||
@ -245,7 +245,7 @@ const MainUI = ($ => {
|
||||
}
|
||||
|
||||
// data-set links
|
||||
$('[data-set-target]').on('click', e => {
|
||||
$('[data-set-target]').on('click', (e) => {
|
||||
const $el = $(e.currentTarget);
|
||||
const $target = $($el.data('set-target'));
|
||||
|
||||
@ -269,7 +269,7 @@ const MainUI = ($ => {
|
||||
});
|
||||
|
||||
// emulate links
|
||||
$('.a[data-href]').on('click', e => {
|
||||
$('.a[data-href]').on('click', (e) => {
|
||||
const $el = $(e.currentTarget);
|
||||
const href = $el.data('href');
|
||||
if (!href.length) {
|
||||
|
Loading…
Reference in New Issue
Block a user