* 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
This commit is contained in:
Hadi Nategh 2015-11-04 15:30:34 +00:00
parent 547338d14c
commit 731e490ade
2 changed files with 13 additions and 1 deletions

View File

@ -332,12 +332,23 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
var drop_action = mgr.getActionById('egw_link_drop'); var drop_action = mgr.getActionById('egw_link_drop');
var drag_action = mgr.getActionById('egw_link_drag'); var drag_action = mgr.getActionById('egw_link_drag');
var drop_cancel = mgr.getActionById('egw_cancel_drop');
if(!this._actionLinks) if(!this._actionLinks)
{ {
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 // Check if this app supports linking
if(!egw.link_get_registry(this.dataStorePrefix || this.egw.appName, 'query') || if(!egw.link_get_registry(this.dataStorePrefix || this.egw.appName, 'query') ||
egw.link_get_registry(this.dataStorePrefix || this.egw.appName, 'title')) egw.link_get_registry(this.dataStorePrefix || this.egw.appName, 'title'))

View File

@ -1249,6 +1249,7 @@ class infolog_ui
} }
$actions['info_drop_mail'] = array( $actions['info_drop_mail'] = array(
'type' => 'drop', 'type' => 'drop',
'caption' => 'Link mail',
'acceptedTypes' => 'mail', 'acceptedTypes' => 'mail',
'onExecute' => 'javaScript:app.infolog.handle_dropped_mail', 'onExecute' => 'javaScript:app.infolog.handle_dropped_mail',
'hideOnDisabled' => true 'hideOnDisabled' => true