mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
[dir view] mv/cp multi dirents: add feedback msg
This commit is contained in:
@@ -1223,7 +1223,9 @@ define([
|
|||||||
} else {
|
} else {
|
||||||
// when mv/cp to another lib, files/dirs should be handled one by one, and need to show progress
|
// when mv/cp to another lib, files/dirs should be handled one by one, and need to show progress
|
||||||
var op_objs = dirents.where({'selected':true}),
|
var op_objs = dirents.where({'selected':true}),
|
||||||
i = 0;
|
i = 0,
|
||||||
|
success_num = 0,
|
||||||
|
first_item;
|
||||||
// progress popup
|
// progress popup
|
||||||
var mv_progress_popup = $(_this.mvProgressTemplate());
|
var mv_progress_popup = $(_this.mvProgressTemplate());
|
||||||
var details = $('#mv-details', mv_progress_popup),
|
var details = $('#mv-details', mv_progress_popup),
|
||||||
@@ -1267,6 +1269,10 @@ define([
|
|||||||
if (op == 'mv') {
|
if (op == 'mv') {
|
||||||
dirents.remove(op_obj);
|
dirents.remove(op_obj);
|
||||||
}
|
}
|
||||||
|
success_num += 1;
|
||||||
|
if (success_num == 1) {
|
||||||
|
first_item = obj_name;
|
||||||
|
}
|
||||||
endOrContinue();
|
endOrContinue();
|
||||||
} else { // failed or canceled
|
} else { // failed or canceled
|
||||||
if (data['failed']) {
|
if (data['failed']) {
|
||||||
@@ -1333,6 +1339,28 @@ define([
|
|||||||
if (op == 'mv') {
|
if (op == 'mv') {
|
||||||
_this.updateMagnificPopupOptions();
|
_this.updateMagnificPopupOptions();
|
||||||
}
|
}
|
||||||
|
if (success_num > 0) {
|
||||||
|
var msg_s;
|
||||||
|
if (op == 'mv') {
|
||||||
|
if (success_num == 1) {
|
||||||
|
msg_s = gettext("Successfully moved %(name)s.");
|
||||||
|
} else if (success_num == 2) {
|
||||||
|
msg_s = gettext("Successfully moved %(name)s and 1 other item.");
|
||||||
|
} else {
|
||||||
|
msg_s = gettext("Successfully moved %(name)s and %(amount)s other items.");
|
||||||
|
}
|
||||||
|
} else { // cp
|
||||||
|
if (success_num == 1) {
|
||||||
|
msg_s = gettext("Successfully copied %(name)s.");
|
||||||
|
} else if (success_num == 2) {
|
||||||
|
msg_s = gettext("Successfully copied %(name)s and 1 other item.");
|
||||||
|
} else {
|
||||||
|
msg_s = gettext("Successfully copied %(name)s and %(amount)s other items.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
msg_s = msg_s.replace('%(name)s', first_item).replace('%(amount)s', success_num - 1);
|
||||||
|
setTimeout(function() { Common.feedback(msg_s, 'success'); }, 600);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mvcpDirent(++i);
|
mvcpDirent(++i);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user