Show confirm dialog when moving folders using drag and drop (#6119)

As it was very easy to accidentally move a folder tree by dragging & dropping
we now ask the user to confirm the action.
pull/6286/head
Aleksander Machniak 6 years ago
parent 526f4ddbb4
commit 67b5ba67dd

@ -71,6 +71,7 @@ CHANGELOG Roundcube Webmail
- Handle inline images also inside multipart/mixed messages (#5905)
- Allow style tags in HTML editor on composed/reply messages (#5751)
- Use Github API as a fallback to fetch js dependencies to workaround throttling issues (#6248)
- Show confirm dialog when moving folders using drag and drop (#6119)
- Fix bug where new_user_dialog email check could have been circumvented by deleting / abandoning session (#5929)
- Fix skin extending for assets (#5115)
- Fix handling of forwarded messages inside of a TNEF message (#5632)

@ -7272,10 +7272,10 @@ function rcube_webmail()
// on the list when dragging starts (and stops), this is slow, but
// I didn't find a method to check droptarget on over event
accept: function(node) {
if (!$(node).is('.mailbox'))
if (!node.is('.mailbox'))
return false;
var source_folder = ref.folder_id2name($(node).attr('id')),
var source_folder = ref.folder_id2name(node.attr('id')),
dest_folder = ref.folder_id2name(this.id),
source = ref.env.subscriptionrows[source_folder],
dest = ref.env.subscriptionrows[dest_folder];
@ -7322,8 +7322,10 @@ function rcube_webmail()
newname = to === '' || to === '*' ? basename : to + this.env.delimiter + basename;
if (newname != from) {
this.http_post('rename-folder', {_folder_oldname: from, _folder_newname: newname},
this.set_busy(true, 'foldermoving'));
this.confirm_dialog(this.get_label('movefolderconfirm'), 'move', function() {
ref.http_post('rename-folder', {_folder_oldname: from, _folder_newname: newname},
ref.set_busy(true, 'foldermoving'));
}, {button_class: 'save move'});
}
}
};

@ -85,6 +85,7 @@ $messages['deletecontactconfirm'] = 'Do you really want to delete selected cont
$messages['deletegroupconfirm'] = 'Do you really want to delete selected group?';
$messages['deletemessagesconfirm'] = 'Do you really want to delete selected message(s)?';
$messages['deletefolderconfirm'] = 'Do you really want to delete this folder?';
$messages['movefolderconfirm'] = 'Do you really want to move this folder?';
$messages['purgefolderconfirm'] = 'Do you really want to delete all messages in this folder?';
$messages['contactdeleting'] = 'Deleting contact(s)...';
$messages['groupdeleting'] = 'Deleting group...';

@ -182,8 +182,9 @@ $OUTPUT->set_env('quota', (bool) $STORAGE->get_capability('QUOTA'));
$OUTPUT->include_script('treelist.js');
// add some labels to client
$OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting',
'foldermoving', 'foldersubscribing', 'folderunsubscribing', 'quota');
$OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'movefolderconfirm',
'folderdeleting', 'foldermoving', 'foldersubscribing', 'folderunsubscribing',
'move', 'quota');
// register UI objects
$OUTPUT->add_handlers(array(

Loading…
Cancel
Save