From 4f83dca7af0111ca9c0d927ed5d33713ab2dcc55 Mon Sep 17 00:00:00 2001 From: Ruslan-Aleev Date: Sun, 18 Jun 2023 15:57:07 +0400 Subject: [PATCH] Add dir/file name in context menu --- .../modext/widgets/system/modx.tree.directory.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/manager/assets/modext/widgets/system/modx.tree.directory.js b/manager/assets/modext/widgets/system/modx.tree.directory.js index 6e3ed9a49f9..77a154bfc24 100644 --- a/manager/assets/modext/widgets/system/modx.tree.directory.js +++ b/manager/assets/modext/widgets/system/modx.tree.directory.js @@ -171,12 +171,19 @@ Ext.extend(MODx.tree.Directory,MODx.tree.Tree,{ ,_showContextMenu: function(node,e) { this.cm.activeNode = node; this.cm.removeAll(); - var m; + var m = []; + + m.push({ + text: ''+node.attributes.text+'' + ,handler: function() {return false;} + ,header: true + }); + m.push('-'); if (node.isRoot) { - m = this.getRootMenu(node); + m = m.concat(this.getRootMenu(node)); } else if (node.attributes.menu && node.attributes.menu.items) { - m = node.attributes.menu.items; + m = m.concat(node.attributes.menu.items); } if (m && m.length > 0) {