mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Get rid of i18nInit and improve i18nUpdate
This commit is contained in:
parent
5b3dfc26de
commit
48974d1b5a
6 changed files with 38 additions and 43 deletions
|
|
@ -2,6 +2,7 @@ import ko from 'ko';
|
|||
import { koComputable } from 'External/ko';
|
||||
import { doc, $htmlCL, elementById, fireEvent } from 'Common/Globals';
|
||||
import { forEachObjectValue, forEachObjectEntry } from 'Common/Utils';
|
||||
import { i18nToNodes } from 'Common/Translator';
|
||||
|
||||
let
|
||||
SCREENS = {},
|
||||
|
|
@ -86,6 +87,7 @@ const
|
|||
|
||||
vm.modalVisible.subscribe(value => {
|
||||
if (value) {
|
||||
i18nToNodes(vmDom);
|
||||
visiblePopups.add(vm);
|
||||
vmDom.style.zIndex = 3000 + (visiblePopups.size * 2);
|
||||
vmDom.showModal();
|
||||
|
|
@ -111,7 +113,6 @@ const
|
|||
ko.applyBindingAccessorsToNode(
|
||||
vmDom,
|
||||
{
|
||||
i18nInit: true,
|
||||
template: () => ({ name: id })
|
||||
},
|
||||
vm
|
||||
|
|
@ -215,6 +216,7 @@ const
|
|||
|
||||
forEachViewModel(vmScreen, (vm, dom) => {
|
||||
vm.beforeShow && vm.beforeShow();
|
||||
i18nToNodes(dom);
|
||||
dom.hidden = false;
|
||||
vm.onShow && vm.onShow();
|
||||
autofocus(dom);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue