mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 15:37:03 +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
|
|
@ -51,4 +51,9 @@ export class AbstractViewNext {
|
|||
|
||||
cancelCommand() {} // eslint-disable-line no-empty-function
|
||||
closeCommand() {} // eslint-disable-line no-empty-function
|
||||
|
||||
querySelector(selectors) {
|
||||
return this.viewModelDom[0].querySelector(selectors);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,6 +246,9 @@ export function showScreenPopup(ViewModelClassToShow, params = []) {
|
|||
|
||||
ModalView.__vm.onShow && ModalView.__vm.onShow(...params);
|
||||
|
||||
const af = ModalView.__dom[0].querySelector('[autofocus]');
|
||||
af && af.focus();
|
||||
|
||||
vmRunHook('view-model-on-show', ModalView, params || []);
|
||||
}
|
||||
}
|
||||
|
|
@ -374,6 +377,9 @@ export function screenOnRoute(screenName, subPart) {
|
|||
ViewModelClass.__vm.onShowTrigger(!ViewModelClass.__vm.onShowTrigger());
|
||||
}
|
||||
|
||||
const af = ViewModelClass.__dom[0].querySelector('[autofocus]');
|
||||
af && af.focus();
|
||||
|
||||
ViewModelClass.__vm.onShowWithDelay && setTimeout(()=>ViewModelClass.__vm.onShowWithDelay, 200);
|
||||
|
||||
vmRunHook('view-model-on-show', ViewModelClass);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue