Skip to content

Commit

Permalink
[cmd:rename] fix Studio-42#2639 change cmd title to "Alias (Preferenc…
Browse files Browse the repository at this point in the history
…e)" of the volume root
  • Loading branch information
nao-pon committed Aug 27, 2018
1 parent faef51d commit ed24a21
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
19 changes: 18 additions & 1 deletion js/commands/rename.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ elFinder.prototype.commands.rename = function() {
// set alwaysEnabled to allow root rename on client size
this.alwaysEnabled = true;

this.syncTitleOnChange = true;

var self = this,
fm = self.fm,
request = function(dfrd, targtes, file, name) {
Expand Down Expand Up @@ -551,7 +553,22 @@ elFinder.prototype.commands.rename = function() {
return dfrd;
};

fm.remove(function(e) {
fm.bind('select contextmenucreate closecontextmenu', function(e) {
var sel = (e.data? (e.data.selected || e.data.targets) : null) || fm.selected(),
file;
if (sel && sel.length === 1 && fm.isRoot(fm.file(sel[0]))) {
self.title = fm.i18n('kindAlias') + ' (' + fm.i18n('preference') + ')';
} else {
self.title = fm.i18n('cmdrename');
}
if (e.type !== 'closecontextmenu') {
self.update(void(0), self.title);
} else {
requestAnimationFrame(function() {
self.update(void(0), self.title);
});
}
}).remove(function(e) {
var rootNames;
if (e.data && e.data.removed && (rootNames = fm.storage('rootNames'))) {
$.each(e.data.removed, function(i, h) {
Expand Down
2 changes: 1 addition & 1 deletion js/i18n/elfinder.LANG.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
'cmdselectnone': 'Select none', // from v2.1.28 added 15.08.2017
'cmdselectinvert': 'Invert selection', // from v2.1.28 added 15.08.2017
'cmdopennew' : 'Open in new window', // from v2.1.38 added 3.4.2018
'cmdhide' : 'Hide (personal)', // from v2.1.41 added 24.7.2018
'cmdhide' : 'Hide (Preference)', // from v2.1.41 added 24.7.2018

/*********************************** buttons ***********************************/
'btnClose' : 'Close',
Expand Down
2 changes: 1 addition & 1 deletion js/i18n/elfinder.en.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ if (typeof elFinder === 'function' && elFinder.prototype.i18) {
'cmdselectnone': 'Select none', // from v2.1.28 added 15.08.2017
'cmdselectinvert': 'Invert selection', // from v2.1.28 added 15.08.2017
'cmdopennew' : 'Open in new window', // from v2.1.38 added 3.4.2018
'cmdhide' : 'Hide (personal)', // from v2.1.41 added 24.7.2018
'cmdhide' : 'Hide (Preference)', // from v2.1.41 added 24.7.2018

/*********************************** buttons ***********************************/
'btnClose' : 'Close',
Expand Down
4 changes: 2 additions & 2 deletions js/i18n/elfinder.ja.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@
'cmdempty' : 'フォルダを空に', // from v2.1.25 added 22.06.2017
'cmdundo' : '元に戻す', // from v2.1.27 added 31.07.2017
'cmdredo' : 'やり直し', // from v2.1.27 added 31.07.2017
'cmdpreference': '環境設定', // from v2.1.27 added 03.08.2017
'cmdpreference': '個人設定', // from v2.1.27 added 03.08.2017
'cmdselectall' : 'すべて選択', // from v2.1.28 added 15.08.2017
'cmdselectnone': '選択解除', // from v2.1.28 added 15.08.2017
'cmdselectinvert': '選択を反転', // from v2.1.28 added 15.08.2017
'cmdopennew' : '新しいウィンドウで開く', // from v2.1.38 added 3.4.2018
'cmdhide' : '非表示(個人的)', // from v2.1.41 added 24.7.2018
'cmdhide' : '非表示 (個人設定)', // from v2.1.41 added 24.7.2018

/*********************************** buttons ***********************************/
'btnClose' : '閉じる',
Expand Down

0 comments on commit ed24a21

Please sign in to comment.