Skip to content

Commit 5673841

Browse files
authored
Merge pull request #95 from sfeir-open-source/fix/69-import-bug
fix: #69 import bug
2 parents 1ba650c + 9c7eb55 commit 5673841

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

src/plugins/input/keyboard/index.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1+
'use strict';
2+
13
import config from '@config/config.json';
4+
import { Plugin } from '@plugins/plugin.js';
25

3-
class KeyboardInput {
6+
class KeyboardInput extends Plugin {
47
constructor() {
5-
this.usedByAComponent = true;
8+
super();
69
this.type = 'inputEvent';
7-
this.callbacks = [];
8-
this.initialized = false;
9-
}
10-
11-
onEvent(callback) {
12-
this.callbacks.push(callback);
1310
}
1411

1512
init() {

src/plugins/input/touch-pointer/index.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
class TouchPointerInput {
1+
'use strict';
2+
3+
import { Plugin } from '@plugins/plugin.js';
4+
5+
class TouchPointerInput extends Plugin {
26
constructor() {
3-
this.usedByAComponent = true;
7+
super();
48
this.type = 'touchPointerEvent';
5-
this.callbacks = [];
69
this.zooming = false;
710
this.pointer = { x: 0, y: 0, color: '#FF0000' };
811
this.interval;
912
this.messageEventRegistered = false;
10-
this.initialized = false;
11-
}
12-
13-
onEvent(callback) {
14-
this.callbacks.push(callback);
1513
}
1614

1715
init() {

src/plugins/input/touch/index.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1+
'use strict';
2+
13
import contextService from '@services/context';
4+
import { Plugin } from '@plugins/plugin.js';
25

3-
class TouchInput {
6+
class TouchInput extends Plugin {
47
constructor() {
5-
this.usedByAComponent = true;
8+
super();
69
this.type = 'inputEvent';
710
this.touchPosition = {
811
touchstart: { clientX: 0, clientY: 0 },
912
touchend: { clientX: 0, clientY: 0 }
1013
};
11-
this.callbacks = [];
12-
this.initialized = false;
13-
}
14-
15-
onEvent(callback) {
16-
this.callbacks.push(callback);
1714
}
1815

1916
init() {

src/plugins/plugin.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
export class Plugin {
4+
constructor() {
5+
this.usedByAComponent = true;
6+
this.initialized = false;
7+
this.callbacks = [];
8+
}
9+
10+
onEvent(callback) {
11+
this.callbacks.push(callback);
12+
}
13+
}

0 commit comments

Comments
 (0)