From 7bf75e349eb7d417fc311cadd03c51907eb3986e Mon Sep 17 00:00:00 2001 From: nao-pon Date: Thu, 12 Nov 2015 18:02:27 +0900 Subject: [PATCH] [ui:cwd] correction of multi-line filename editing --- js/commands/rename.js | 17 ++++++++++++----- js/elFinder.resources.js | 25 +++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/js/commands/rename.js b/js/commands/rename.js index 67f710532b..39d65fa321 100644 --- a/js/commands/rename.js +++ b/js/commands/rename.js @@ -27,6 +27,12 @@ elFinder.prototype.commands.rename = function() { type = (hashes && hashes._type)? hashes._type : (fm.selected().length? 'files' : 'navbar'), incwd = (fm.cwd().hash == file.hash), tarea = (type === 'files' && fm.storage('view') != 'list'), + rest = function(){ + if (tarea) { + node.parent().zIndex('').css('position', ''); + node.css('max-height', ''); + } + }, dfrd = $.Deferred() .done(function(data){ incwd && fm.exec('open', data.added[0].hash); @@ -35,6 +41,10 @@ elFinder.prototype.commands.rename = function() { var parent = input.parent(), name = fm.escape(file.name); + if (tarea) { + name = name.replace(/([_.])/g, '​$1'); + } + rest(); if (type === 'navbar') { input.replaceWith(name); } else { @@ -52,16 +62,12 @@ elFinder.prototype.commands.rename = function() { error && fm.error(error); }) .always(function() { - if (tarea) { - node.parent().zIndex('').css('position', ''); - node.css('max-height', ''); - } fm.enable(); }), input = $(tarea? '