Fix Overwrite/Skip buttons in copy/move dialog (Bifrost#T57654)
This commit is contained in:
parent
d5d0248a58
commit
65726f4217
1 changed files with 10 additions and 7 deletions
|
@ -890,9 +890,9 @@ function kolab_dialog_submit_handler()
|
|||
};
|
||||
|
||||
// Hides dialog
|
||||
function kolab_dialog_close(dialog)
|
||||
function kolab_dialog_close(dialog, destroy)
|
||||
{
|
||||
(rcmail.is_framed() ? window.parent : window).$(dialog).dialog('close');
|
||||
(rcmail.is_framed() ? window.parent : window).$(dialog).dialog(destroy ? 'destroy' : 'close');
|
||||
};
|
||||
|
||||
// smart upload button
|
||||
|
@ -3147,7 +3147,7 @@ function kolab_files_ui()
|
|||
this.file_move_ask_user = function(list, move)
|
||||
{
|
||||
var file = list[0], buttons = {},
|
||||
text = rcmail.gettext('kolab_files.filemoveconfirm').replace('$file', file.dst)
|
||||
text = rcmail.gettext('kolab_files.filemoveconfirm').replace('$file', file.dst),
|
||||
dialog = $('<div></div>');
|
||||
|
||||
buttons[rcmail.gettext('kolab_files.fileoverwrite')] = function() {
|
||||
|
@ -3157,7 +3157,8 @@ function kolab_files_ui()
|
|||
f[file.src] = file.dst;
|
||||
file_api.file_move_ask_list = list;
|
||||
file_api.file_move_ask_mode = move;
|
||||
dialog.dialog('destroy').remove();
|
||||
kolab_dialog_close(this, true);
|
||||
|
||||
file_api.req = file_api.set_busy(true, move ? 'kolab_files.filemoving' : 'kolab_files.filecopying');
|
||||
file_api.request(action, {file: f, overwrite: 1}, 'file_move_ask_user_response');
|
||||
};
|
||||
|
@ -3167,14 +3168,15 @@ function kolab_files_ui()
|
|||
var f = {}, action = move ? 'file_move' : 'file_copy';
|
||||
|
||||
$.each(list, function() { f[this.src] = this.dst; });
|
||||
dialog.dialog('destroy').remove();
|
||||
kolab_dialog_close(this, true);
|
||||
|
||||
file_api.req = file_api.set_busy(true, move ? 'kolab_files.filemoving' : 'kolab_files.filecopying');
|
||||
file_api.request(action, {file: f, overwrite: 1}, action + '_response');
|
||||
};
|
||||
|
||||
var skip_func = function() {
|
||||
list.shift();
|
||||
dialog.dialog('destroy').remove();
|
||||
kolab_dialog_close(this, true);
|
||||
|
||||
if (list.length)
|
||||
file_api.file_move_ask_user(list, move);
|
||||
|
@ -3186,7 +3188,7 @@ function kolab_files_ui()
|
|||
|
||||
if (list.length > 1)
|
||||
buttons[rcmail.gettext('kolab_files.fileskipall')] = function() {
|
||||
dialog.dialog('destroy').remove();
|
||||
kolab_dialog_close(this, true);
|
||||
if (move)
|
||||
file_api.file_list();
|
||||
};
|
||||
|
@ -3195,6 +3197,7 @@ function kolab_files_ui()
|
|||
kolab_dialog_show(dialog.html(text), {
|
||||
close: skip_func,
|
||||
buttons: buttons,
|
||||
height: 50,
|
||||
minWidth: 400,
|
||||
width: 400
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue