Removed: KnockoutJS 'hasFocus:' because HTML5 has autofocus=""

Knoin.js now searches for [autofocus] and handles it
This commit is contained in:
djmaze 2020-08-22 01:03:03 +02:00
parent 226f77e392
commit 996723a486
18 changed files with 60 additions and 113 deletions

View file

@ -18,9 +18,6 @@ class AskPopupView extends AbstractViewNext {
this.yesButton = ko.observable('');
this.noButton = ko.observable('');
this.yesFocus = ko.observable(false);
this.noFocus = ko.observable(false);
this.fYesAction = null;
this.fNoAction = null;
@ -34,9 +31,6 @@ class AskPopupView extends AbstractViewNext {
this.yesButton(i18n('POPUPS_ASK/BUTTON_YES'));
this.noButton(i18n('POPUPS_ASK/BUTTON_NO'));
this.yesFocus(false);
this.noFocus(false);
this.fYesAction = null;
this.fNoAction = null;
}
@ -87,17 +81,17 @@ class AskPopupView extends AbstractViewNext {
onShowWithDelay() {
if (this.bFocusYesOnShow) {
this.yesFocus(true);
this.querySelector('.buttonYes').focus();
}
}
onBuild() {
key('tab, shift+tab, right, left', KeyState.PopupAsk, () => {
if (this.yesFocus()) {
this.noFocus(true);
} else {
this.yesFocus(true);
let btn = this.querySelector('.buttonYes');
if (btn.matches(':focus')) {
btn = this.querySelector('.buttonNo');
}
btn.focus();
return false;
});