From 07c31ce81e077a639013f6f037ba8935bc4a3d65 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 15 Feb 2017 16:11:23 +0200 Subject: [PATCH] chore(sort) es2015-ify --- client/sort.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/client/sort.js b/client/sort.js index a69faba6..2e10014a 100644 --- a/client/sort.js +++ b/client/sort.js @@ -3,16 +3,17 @@ /* global CloudCmd */ const DOM = require('./dom'); -var Info = DOM.CurrentInfo; -var sort = CloudCmd.sort; -var order = CloudCmd.order; -var position = DOM.getPanelPosition(); -var sortPrevious = sort[position]; +const Info = DOM.CurrentInfo; +const sort = CloudCmd.sort; +const order = CloudCmd.order; +const position = DOM.getPanelPosition(); -CloudCmd.sortPanel = function(name, panel) { - panel = panel || DOM.getPanel(); - - var position = panel +let sortPrevious = sort[position]; + +const {getPanel} = DOM; + +CloudCmd.sortPanel = (name, panel = getPanel()) => { + const position = panel .dataset .name .replace('js-', ''); @@ -33,3 +34,4 @@ CloudCmd.sortPanel = function(name, panel) { noCurrent: position !== Info.panelPosition }); }; +