Build update

This commit is contained in:
Francisco Hodge
2019-03-06 20:00:48 -05:00
parent 0d82696868
commit ec983bf82b
6 changed files with 102 additions and 56 deletions
+27 -4
View File
@@ -79,7 +79,33 @@ class SimpleKeyboard {
/**
* Bindings
*/
Utilities.bindMethods(SimpleKeyboard, this);
this.handleButtonClicked = this.handleButtonClicked.bind(this);
this.syncInstanceInputs = this.syncInstanceInputs.bind(this);
this.clearInput = this.clearInput.bind(this);
this.getInput = this.getInput.bind(this);
this.setInput = this.setInput.bind(this);
this.replaceInput = this.replaceInput.bind(this);
this.clear = this.clear.bind(this);
this.dispatch = this.dispatch.bind(this);
this.addButtonTheme = this.addButtonTheme.bind(this);
this.removeButtonTheme = this.removeButtonTheme.bind(this);
this.getButtonElement = this.getButtonElement.bind(this);
this.handleCaret = this.handleCaret.bind(this);
this.caretEventHandler = this.caretEventHandler.bind(this);
this.onInit = this.onInit.bind(this);
this.onRender = this.onRender.bind(this);
this.render = this.render.bind(this);
this.loadModules = this.loadModules.bind(this);
this.handleButtonMouseUp = this.handleButtonMouseUp.bind(this);
this.handleButtonMouseDown = this.handleButtonMouseDown.bind(this);
this.handleButtonHold = this.handleButtonHold.bind(this);
this.onModulesLoaded = this.onModulesLoaded.bind(this);
this.inputPatternIsValid = this.inputPatternIsValid.bind(this);
this.beforeFirstRender = this.beforeFirstRender.bind(this);
this.beforeRender = this.beforeRender.bind(this);
this.disableContextualWindow = this.disableContextualWindow.bind(this);
this.onTouchDeviceDetected = this.onTouchDeviceDetected.bind(this);
this.processAutoTouchEvents = this.processAutoTouchEvents.bind(this);
/**
* simple-keyboard uses a non-persistent internal input to keep track of the entered string (the variable `keyboard.input`).
@@ -647,7 +673,6 @@ class SimpleKeyboard {
return buttonThemesParsed;
}
/* istanbul ignore next */
onTouchDeviceDetected() {
/**
* Processing autoTouchEvents
@@ -677,7 +702,6 @@ class SimpleKeyboard {
/**
* Process autoTouchEvents option
*/
/* istanbul ignore next */
processAutoTouchEvents() {
if (this.options.autoUseTouchEvents) {
this.options.useTouchEvents = true;
@@ -713,7 +737,6 @@ class SimpleKeyboard {
/**
* Performing actions when touch device detected
*/
/* istanbul ignore next */
if (this.utilities.isTouchDevice()) {
this.onTouchDeviceDetected();
}
+25
View File
@@ -977,6 +977,31 @@ it('Keyboard inputPattern will work by input name', () => {
expect(keyboard.getInput()).toBe("q1");
});
it('Keyboard processAutoTouchEvents will work', () => {
testUtil.setDOM();
navigator.maxTouchPoints = true;
let keyboard = new Keyboard({
autoUseTouchEvents: true
});
expect(keyboard.options.useTouchEvents).toBeTruthy();
});
it('Keyboard processAutoTouchEvents will work with debugging enabled', () => {
testUtil.setDOM();
navigator.maxTouchPoints = true;
let keyboard = new Keyboard({
autoUseTouchEvents: true,
debug: true
});
expect(keyboard.options.useTouchEvents).toBeTruthy();
});
it('Keyboard beforeFirstRender method will work', () => {
testUtil.setDOM();