mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Removed: KnockoutJS 'hasFocus:' because HTML5 has autofocus=""
Knoin.js now searches for [autofocus] and handles it
This commit is contained in:
parent
226f77e392
commit
996723a486
18 changed files with 60 additions and 113 deletions
|
|
@ -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;
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue