From abf5ed6cb5c3a42bc7377e05b51e9950a7875477 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 25 Sep 2017 17:27:17 +0200 Subject: [PATCH] Remove edit action: - Let the "open" action finds out about the correct handler based on file's mime type --- filemanager/inc/class.filemanager_ui.inc.php | 7 ------- filemanager/js/app.js | 14 +++++++------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/filemanager/inc/class.filemanager_ui.inc.php b/filemanager/inc/class.filemanager_ui.inc.php index 2a0e0c2b84..e35160ad26 100644 --- a/filemanager/inc/class.filemanager_ui.inc.php +++ b/filemanager/inc/class.filemanager_ui.inc.php @@ -131,13 +131,6 @@ class filemanager_ui 'onExecute' => 'javaScript:app.filemanager.open', 'default' => true ), - 'modify' => array( - 'caption' => lang('Edit'), - 'group' => $group, - 'icon' => 'edit', - 'onExecute' => 'javaScript:app.filemanager.open', - 'enabled' => 'javaScript:app.filemanager.isEditable', - ), 'new' => array( 'caption' => 'New', 'group' => $group, diff --git a/filemanager/js/app.js b/filemanager/js/app.js index 5c9cb8c8d3..4288620ee7 100644 --- a/filemanager/js/app.js +++ b/filemanager/js/app.js @@ -300,7 +300,7 @@ app.classes.filemanager = AppJS.extend( }, - + /** @@ -771,7 +771,7 @@ app.classes.filemanager = AppJS.extend( { mime_dom.click(); } - else if (_action.id == 'modify' && mime && data.data.mime.match(mime.mime_odf_regex)) + else if (mime && this.isEditable(_action, _senders)) { egw.open_link(egw.link('/index.php', { menuaction: 'filemanager.filemanager_ui.editor', @@ -1161,7 +1161,7 @@ app.classes.filemanager = AppJS.extend( }, - /** + /** * share-link callback */ @@ -1171,10 +1171,10 @@ app.classes.filemanager = AppJS.extend( var copy_link_to_clipboard = null; - var copy_link_to_clipboard = function(evt){ + var copy_link_to_clipboard = function(evt){ var $target = jQuery(evt.target); $target.select(); - + console.log("share_link click"); try { @@ -1192,9 +1192,9 @@ app.classes.filemanager = AppJS.extend( jQuery("body").on("click", "[name=share_link]", copy_link_to_clipboard); var dialog = et2_createWidget("dialog",{ - callback: function( button_id, value){ + callback: function( button_id, value){ jQuery("body").off("click", "[name=share_link]", copy_link_to_clipboard); - return true; + return true; }, title: "Share", template: _data.template,