Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/util/swipe.js')
-rw-r--r--js/src/util/swipe.js28
1 files changed, 17 insertions, 11 deletions
diff --git a/js/src/util/swipe.js b/js/src/util/swipe.js
index 87a5f7f5ae..ac09b6fa13 100644
--- a/js/src/util/swipe.js
+++ b/js/src/util/swipe.js
@@ -5,8 +5,9 @@
* --------------------------------------------------------------------------
*/
+import Config from './config'
import EventHandler from '../dom/event-handler'
-import { execute, typeCheckConfig } from './index'
+import { execute } from './index'
/**
* Constants
@@ -40,8 +41,9 @@ const DefaultType = {
* Class definition
*/
-class Swipe {
+class Swipe extends Config {
constructor(element, config) {
+ super()
this._element = element
if (!element || !Swipe.isSupported()) {
@@ -54,6 +56,19 @@ class Swipe {
this._initEvents()
}
+ // Getters
+ static get Default() {
+ return Default
+ }
+
+ static get DefaultType() {
+ return DefaultType
+ }
+
+ static get NAME() {
+ return NAME
+ }
+
// Public
dispose() {
EventHandler.off(this._element, EVENT_KEY)
@@ -118,15 +133,6 @@ class Swipe {
}
}
- _getConfig(config) {
- config = {
- ...Default,
- ...(typeof config === 'object' ? config : {})
- }
- typeCheckConfig(NAME, config, DefaultType)
- return config
- }
-
_eventIsPointerPenTouch(event) {
return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)
}