1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-26 06:24:28 +02:00

Fix touch events

This commit is contained in:
Luis
2017-04-26 21:31:50 +02:00
parent 4be762c6c0
commit ff4029dbef
7 changed files with 16 additions and 14 deletions

View File

@@ -8,7 +8,7 @@
}, },
"rules": { "rules": {
"no-cond-assign": 0, "no-cond-assign": 0,
"no-console": 2, "no-console": 0,
"no-constant-condition": 2, "no-constant-condition": 2,
"no-control-regex": 2, "no-control-regex": 2,
"no-debugger": 2, "no-debugger": 2,

View File

@@ -407,9 +407,10 @@ export default class WebSlides {
/** /**
* Checks if it is disabled * Checks if it is disabled
* @return {boolean}
*/ */
isDisabled() { isDisabled() {
this.el.classList.contains(CLASSES.DISABLED); return this.el.classList.contains(CLASSES.DISABLED);
} }
/** /**

View File

@@ -29,7 +29,7 @@ export default class Keyboard {
let method; let method;
let argument; let argument;
if (DOM.isFocusableElement() || !this.ws_.isDisabled()) { if (DOM.isFocusableElement() || this.ws_.isDisabled()) {
return; return;
} }

View File

@@ -71,7 +71,7 @@ export default class Scroll {
* @private * @private
*/ */
onMouseWheel_(event) { onMouseWheel_(event) {
if (!this.ws_.isDisabled()) { if (this.ws_.isDisabled()) {
return; return;
} }

View File

@@ -108,7 +108,7 @@ export default class Touch {
* @private * @private
*/ */
onStart_(event) { onStart_(event) {
if (!this.ws_.isDisabled()) { if (this.ws_.isDisabled()) {
return; return;
} }
@@ -132,7 +132,7 @@ export default class Touch {
* @private * @private
*/ */
onMove_(event) { onMove_(event) {
if (!this.ws_.isDisabled()) { if (this.ws_.isDisabled()) {
return; return;
} }
@@ -151,7 +151,7 @@ export default class Touch {
* @private * @private
*/ */
onStop_() { onStop_() {
if (!this.ws_.isDisabled()) { if (this.ws_.isDisabled()) {
return; return;
} }

View File

@@ -1161,12 +1161,13 @@ var WebSlides = function () {
/** /**
* Checks if it is disabled * Checks if it is disabled
* @return {boolean}
*/ */
}, { }, {
key: 'isDisabled', key: 'isDisabled',
value: function isDisabled() { value: function isDisabled() {
this.el.classList.contains(CLASSES.DISABLED); return this.el.classList.contains(CLASSES.DISABLED);
} }
/** /**
@@ -1586,7 +1587,7 @@ var Keyboard = function () {
var method = void 0; var method = void 0;
var argument = void 0; var argument = void 0;
if (__WEBPACK_IMPORTED_MODULE_1__utils_dom__["a" /* default */].isFocusableElement() || !this.ws_.isDisabled()) { if (__WEBPACK_IMPORTED_MODULE_1__utils_dom__["a" /* default */].isFocusableElement() || this.ws_.isDisabled()) {
return; return;
} }
@@ -1939,7 +1940,7 @@ var Scroll = function () {
}, { }, {
key: 'onMouseWheel_', key: 'onMouseWheel_',
value: function onMouseWheel_(event) { value: function onMouseWheel_(event) {
if (!this.ws_.isDisabled()) { if (this.ws_.isDisabled()) {
return; return;
} }
@@ -2110,7 +2111,7 @@ var Touch = function () {
_createClass(Touch, [{ _createClass(Touch, [{
key: 'onStart_', key: 'onStart_',
value: function onStart_(event) { value: function onStart_(event) {
if (!this.ws_.isDisabled()) { if (this.ws_.isDisabled()) {
return; return;
} }
@@ -2137,7 +2138,7 @@ var Touch = function () {
}, { }, {
key: 'onMove_', key: 'onMove_',
value: function onMove_(event) { value: function onMove_(event) {
if (!this.ws_.isDisabled()) { if (this.ws_.isDisabled()) {
return; return;
} }
@@ -2159,7 +2160,7 @@ var Touch = function () {
}, { }, {
key: 'onStop_', key: 'onStop_',
value: function onStop_() { value: function onStop_() {
if (!this.ws_.isDisabled()) { if (this.ws_.isDisabled()) {
return; return;
} }

File diff suppressed because one or more lines are too long