From 753db12b2d8d9198d866cc0687502b8f4634327f Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Apr 2018 12:29:54 +0300 Subject: [PATCH] fix(listeners) onPathElementClick: empty space (#171) --- client/listeners/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/listeners/index.js b/client/listeners/index.js index 14e0afdd..05e74128 100644 --- a/client/listeners/index.js +++ b/client/listeners/index.js @@ -16,6 +16,9 @@ const { apiURL } = require('../../common/cloudfunc'); +const NBSP_REG = RegExp(String.fromCharCode(160), 'g'); +const SPACE = ' '; + module.exports.init = () => { contextMenu(); dragndrop(); @@ -208,7 +211,9 @@ function onPathElementClick(panel, event) { */ link = link.replace('%%', '%25%'); link = decodeURI(link); + link = link.replace(RegExp('^' + prefix + FS), '') || '/'; + link = link.replace(NBSP_REG, SPACE); noCurrent = isNoCurrent(panel);