mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
[win-nix] refactoring
This commit is contained in:
@ -115,6 +115,7 @@
|
||||
utils.fn.extend(ControllerPortals.prototype, (function() {
|
||||
let collection,
|
||||
ppmenu;
|
||||
let dlgLogin;
|
||||
|
||||
function _on_context_menu(menu, action, data) {
|
||||
var model = data;
|
||||
@ -133,17 +134,22 @@
|
||||
};
|
||||
|
||||
function _do_login(portal, user) {
|
||||
var dlg = new LoginDlg();
|
||||
dlg.onsuccess(info => {
|
||||
console.log('redirect to portal');
|
||||
window.sdk.execCommand("portal:open", info.portal);
|
||||
if ( !dlgLogin ) {
|
||||
dlgLogin = new LoginDlg();
|
||||
dlgLogin.onsuccess(info => {
|
||||
window.sdk.execCommand("portal:open", info.portal);
|
||||
|
||||
PortalsStore.keep(info);
|
||||
_update_portals.call(this);
|
||||
dlgLogin.onclose();
|
||||
PortalsStore.keep(info);
|
||||
_update_portals.call(this);
|
||||
|
||||
window.selectAction('connect');
|
||||
});
|
||||
dlg.show(portal, user);
|
||||
window.selectAction('connect');
|
||||
});
|
||||
dlgLogin.onclose(code=>{
|
||||
dlgLogin = undefined;
|
||||
});
|
||||
dlgLogin.show(portal, user);
|
||||
}
|
||||
};
|
||||
|
||||
function _do_logout(info) {
|
||||
|
||||
@ -219,6 +219,7 @@ utils.fn.parseRecent = function(arr, out = 'files') {
|
||||
name: name,
|
||||
descr: path,
|
||||
date: _f_.modifyed
|
||||
, path: fn
|
||||
});
|
||||
|
||||
_dirs_arr.indexOf(path) < 0 && _dirs_arr.push(path);
|
||||
@ -247,6 +248,10 @@ utils.fn.parseRecent = function(arr, out = 'files') {
|
||||
return out_dirs_arr;
|
||||
}
|
||||
|
||||
utils.fn.decodeHtml = function(str) {
|
||||
return $('<div>').html(str).text();
|
||||
}
|
||||
|
||||
function getUrlParams() {
|
||||
var e,
|
||||
a = /\+/g,
|
||||
|
||||
Reference in New Issue
Block a user