djmaze 2020-07-20 11:26:40 +02:00
parent f16f604f48
commit ec3fd5b7e4
8 changed files with 3 additions and 493 deletions

View file

@ -4,7 +4,7 @@ import $ from '$';
import ko from 'ko';
import { Notification, UploadErrorCode } from 'Common/Enums';
import { pInt, isUnd, isNull, has, microtime, inArray } from 'Common/Utils';
import { $html, $htmlCL, bAnimationSupported } from 'Common/Globals';
import { $html, $htmlCL } from 'Common/Globals';
import { reload as momentorReload } from 'Common/Momentor';
import { langLink } from 'Common/Links';
@ -137,22 +137,11 @@ const i18nToNode = (element) => {
* @param {Object} elements
* @param {boolean=} animate = false
*/
export function i18nToNodes(elements, animate = false) {
export function i18nToNodes(elements) {
_.defer(() => {
$('[data-i18n]', elements).each((index, item) => {
i18nToNode(item);
});
if (animate && bAnimationSupported) {
$('.i18n-animation[data-i18n]', elements).letterfx({
'fx': 'fall fade',
'backwards': false,
'timing': 50,
'fx_duration': '50ms',
'letter_end': 'restore',
'element_end': 'restore'
});
}
});
}
@ -160,7 +149,7 @@ const reloadData = () => {
if (window.rainloopI18N) {
I18N_DATA = window.rainloopI18N || {};
i18nToNodes(window.document, true);
i18nToNodes(window.document);
momentorReload();
trigger(!trigger());