diff --git a/client/client.js b/client/client.js index f17e0b23..4d53c634 100644 --- a/client/client.js +++ b/client/client.js @@ -94,6 +94,7 @@ function CloudCmdProto(DOM) { imgPosition = 'top'; Images.show.load(imgPosition, panel); + /* загружаем содержимое каталога */ await ajaxLoad(addSlashToEnd(path), { refresh, @@ -237,7 +238,7 @@ function CloudCmdProto(DOM) { const dirPath = DOM.getCurrentDirPath(); - Listeners = CloudCmd.Listeners; + ({Listeners} = CloudCmd); Listeners.init(); const panels = getPanels(); diff --git a/client/dom/load-remote.js b/client/dom/load-remote.js index 72fb9db9..84c7e329 100644 --- a/client/dom/load-remote.js +++ b/client/dom/load-remote.js @@ -29,7 +29,7 @@ module.exports = (name, options, callback = options) => { if (isArray) { remoteTmpls = module.remote; - local = module.local; + ({local} = module); } else { remoteTmpls = [module.remote]; local = [module.local]; diff --git a/client/dom/load.js b/client/dom/load.js index 9148c1b8..03c25d73 100644 --- a/client/dom/load.js +++ b/client/dom/load.js @@ -63,7 +63,7 @@ module.exports.ajax = (params) => { if (!isArrayBuf && isObject || isArray) data = jonny.stringify(p.data); else - data = p.data; + ({data} = p); xhr.onreadystatechange = (event) => { const xhr = event.target; diff --git a/client/listeners/index.js b/client/listeners/index.js index 78342411..3bd0ce9c 100644 --- a/client/listeners/index.js +++ b/client/listeners/index.js @@ -216,7 +216,7 @@ async function onPathElementClick(panel, event) { function copyPath(el) { clipboard .writeText(el - .parentElement.title) + .parentElement.title) .then(CloudCmd.log) .catch(CloudCmd.log); } diff --git a/client/modules/menu.js b/client/modules/menu.js index 8f739164..6ab88453 100644 --- a/client/modules/menu.js +++ b/client/modules/menu.js @@ -276,6 +276,7 @@ function download(type) { const path = DOM.getCurrentPath(file); CloudCmd.log(`downloading file ${path}...`); + /* * if we send ajax request - * no need in hash so we escape # diff --git a/client/modules/operation/index.js b/client/modules/operation/index.js index 68d17a33..bf19bda8 100644 --- a/client/modules/operation/index.js +++ b/client/modules/operation/index.js @@ -343,10 +343,13 @@ async function _processFiles(options, data) { let names = []; if (data) { - from = data.from; - to = data.to; - names = data.names; - panel = Info.panel; + ({ + from, + to, + names, + } = data); + + ({panel} = Info); } else { from = Info.dirPath; to = DOM.getNotCurrentDirPath(); diff --git a/client/modules/user-menu/navigate.js b/client/modules/user-menu/navigate.js index 445d47d1..d3c89830 100644 --- a/client/modules/user-menu/navigate.js +++ b/client/modules/user-menu/navigate.js @@ -2,12 +2,7 @@ const fullstore = require('fullstore'); -const { - J, - K, - UP, - DOWN, -} = require('../../key/key.js'); +const {J, K, UP, DOWN} = require('../../key/key.js'); const store = fullstore(1); const isDigit = (a) => /^\d+$/.test(a); diff --git a/client/modules/user-menu/navigate.spec.js b/client/modules/user-menu/navigate.spec.js index abf95aab..5dbbfb81 100644 --- a/client/modules/user-menu/navigate.spec.js +++ b/client/modules/user-menu/navigate.spec.js @@ -3,12 +3,7 @@ const test = require('supertape'); const navigate = require('./navigate'); -const { - UP, - DOWN, - J, - K, -} = require('../../key/key.js'); +const {UP, DOWN, J, K} = require('../../key/key.js'); test('cloudcmd: user-menu: navigate: DOWN', (t) => { const el = {