mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 05:59:21 +03:00
Code refactoring (2) (es5 -> es2015)
This commit is contained in:
parent
38a1041a73
commit
a2308e251b
23 changed files with 760 additions and 821 deletions
|
|
@ -199,31 +199,30 @@ export function initNotificationLanguage()
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {Function} callback
|
||||
* @param {Object} scope
|
||||
* @param {Function} startCallback
|
||||
* @param {Function=} langCallback = null
|
||||
*/
|
||||
export function initOnStartOrLangChange(callback, scope, langCallback = null)
|
||||
export function initOnStartOrLangChange(startCallback, langCallback = null)
|
||||
{
|
||||
if (callback)
|
||||
if (startCallback)
|
||||
{
|
||||
callback.call(scope);
|
||||
startCallback();
|
||||
}
|
||||
|
||||
if (langCallback)
|
||||
{
|
||||
trigger.subscribe(() => {
|
||||
if (callback)
|
||||
if (startCallback)
|
||||
{
|
||||
callback.call(scope);
|
||||
startCallback();
|
||||
}
|
||||
|
||||
langCallback.call(scope);
|
||||
langCallback();
|
||||
});
|
||||
}
|
||||
else if (callback)
|
||||
else if (startCallback)
|
||||
{
|
||||
trigger.subscribe(callback, scope);
|
||||
trigger.subscribe(startCallback);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,6 +112,24 @@ export function decodeURIComponent(component)
|
|||
return window.decodeURIComponent(component);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} url
|
||||
* @returns {string}
|
||||
*/
|
||||
export function decodeURI(url)
|
||||
{
|
||||
return window.decodeURI(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} url
|
||||
* @returns {string}
|
||||
*/
|
||||
export function encodeURI(url)
|
||||
{
|
||||
return window.encodeURI(url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} queryString
|
||||
* @returns {Object}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue