mirror of
https://github.com/a2nt/webpack-bootstrap-ui-kit.git
synced 2024-10-22 11:05:45 +02:00
IMPR: Multi-slider and hover
This commit is contained in:
parent
416b160349
commit
b62fe6a817
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate",
|
"name": "@a2nt/ss-bootstrap-ui-webpack-boilerplate",
|
||||||
"version": "2.3.3",
|
"version": "2.3.4",
|
||||||
"author": "Tony Air <tony@twma.pro>",
|
"author": "Tony Air <tony@twma.pro>",
|
||||||
"license": "MIT",
|
"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.",
|
"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.",
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import Events from '../_events';
|
import Events from '../_events';
|
||||||
import 'jquery-hoverintent/jquery.hoverIntent.js';
|
import 'jquery-hoverintent/jquery.hoverIntent.js';
|
||||||
|
import MainUI from '../_main';
|
||||||
|
|
||||||
const HoverUI = (($) => {
|
const HoverUI = (($) => {
|
||||||
// Constants
|
// Constants
|
||||||
@ -20,6 +21,8 @@ const HoverUI = (($) => {
|
|||||||
class HoverUI {
|
class HoverUI {
|
||||||
// Constructor
|
// Constructor
|
||||||
constructor(el) {
|
constructor(el) {
|
||||||
|
console.log(`${NAME}: init`);
|
||||||
|
|
||||||
const ui = this;
|
const ui = this;
|
||||||
const $el = $(el);
|
const $el = $(el);
|
||||||
ui.$el = $el;
|
ui.$el = $el;
|
||||||
@ -36,8 +39,8 @@ const HoverUI = (($) => {
|
|||||||
$target = $target
|
$target = $target
|
||||||
? $target
|
? $target
|
||||||
: $parent
|
: $parent
|
||||||
? $parent.find('.dropdown-menu').first()
|
? $parent.find('.dropdown-menu').first()
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (!$target || !$target.length) {
|
if (!$target || !$target.length) {
|
||||||
console.warn(`${NAME}: Missing target for:`);
|
console.warn(`${NAME}: Missing target for:`);
|
||||||
@ -52,6 +55,7 @@ const HoverUI = (($) => {
|
|||||||
|
|
||||||
// integrate with dropdown-toggle
|
// integrate with dropdown-toggle
|
||||||
$('[data-toggle="dropdown"]').on('click touch', (e) => {
|
$('[data-toggle="dropdown"]').on('click touch', (e) => {
|
||||||
|
console.log(`${NAME}: dropdown click-touch`);
|
||||||
ui.hide();
|
ui.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -68,11 +72,18 @@ const HoverUI = (($) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$el.off('click touch');
|
||||||
$el.on('click touch', (e) => {
|
$el.on('click touch', (e) => {
|
||||||
|
const size = MainUI.detectBootstrapScreenSize();
|
||||||
|
console.log(`${NAME}: click-touch size: ${size}`);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
size === 'xs' ||
|
||||||
!$el.data('allow-click') ||
|
!$el.data('allow-click') ||
|
||||||
(W.IsTouchScreen && !$el.data('allow-touch-click'))
|
(W.IsTouchScreen && !$el.data('allow-touch-click'))
|
||||||
) {
|
) {
|
||||||
|
console.log(`${NAME}: click-touch prevent click`);
|
||||||
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import Events from '../_events';
|
import Events from '../_events';
|
||||||
|
import MainUI from '../_main';
|
||||||
|
|
||||||
import 'hammerjs/hammer';
|
import 'hammerjs/hammer';
|
||||||
import 'jquery-hammerjs/jquery.hammer';
|
import 'jquery-hammerjs/jquery.hammer';
|
||||||
|
|
||||||
import '../../scss/_components/_ui.multislider.scss';
|
import '../../scss/_components/_ui.multislider.scss';
|
||||||
|
|
||||||
import MainUI from '../_main';
|
|
||||||
const W = window;
|
const W = window;
|
||||||
|
|
||||||
const MultiSlider = (($) => {
|
const MultiSlider = (($) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user