From 731e490ade96eb4ae0099f9970444d0c5fce129a Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 4 Nov 2015 15:30:34 +0000 Subject: [PATCH] * All applications: Prompt user to select an action when drag and drop on lists - Implement a generic cancel action for all drop actions on nextmatch --- etemplate/js/et2_extension_nextmatch_controller.js | 13 ++++++++++++- infolog/inc/class.infolog_ui.inc.php | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_extension_nextmatch_controller.js b/etemplate/js/et2_extension_nextmatch_controller.js index 0559bf06a7..80411a2cb1 100644 --- a/etemplate/js/et2_extension_nextmatch_controller.js +++ b/etemplate/js/et2_extension_nextmatch_controller.js @@ -332,12 +332,23 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider, var drop_action = mgr.getActionById('egw_link_drop'); var drag_action = mgr.getActionById('egw_link_drag'); + var drop_cancel = mgr.getActionById('egw_cancel_drop'); if(!this._actionLinks) { this._actionLinks = []; } - + + if (!drop_cancel) + { + // Create a generic cancel action in order to cancel drop action + // applied for all apps plus file and link action. + drop_cancel = mgr.addAction('drop', 'egw_cancel_drop', this.egw.lang('Cancel'), egw.image('cancel'), function(){},true); + drop_cancel.set_group('99'); + drop_cancel.acceptedTypes = drop_cancel.acceptedTypes.concat(Object.keys(egw.user('apps')).concat(['link', 'file'])); + this._actionLinks.push (drop_cancel.id); + } + // Check if this app supports linking if(!egw.link_get_registry(this.dataStorePrefix || this.egw.appName, 'query') || egw.link_get_registry(this.dataStorePrefix || this.egw.appName, 'title')) diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 695d8a97b7..775cf6f95c 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -1249,6 +1249,7 @@ class infolog_ui } $actions['info_drop_mail'] = array( 'type' => 'drop', + 'caption' => 'Link mail', 'acceptedTypes' => 'mail', 'onExecute' => 'javaScript:app.infolog.handle_dropped_mail', 'hideOnDisabled' => true