Skip to content

Commit 337bf70

Browse files
authored
Merge pull request #1684 from mercihabam/fix-move-dropdown
fix(frontend): adjust move/copy dropdown content alignment and fix expand action not working on move action when copy dropdown was not opened beforehand
2 parents ee4e9f3 + 9c88cff commit 337bf70

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

modules/imap/site.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,12 @@
387387
display: flex;
388388
flex-direction: column;
389389
}
390+
.move_to_location .folders .inner_list li {
391+
flex-direction: row;
392+
}
393+
.move_to_location .folders li.m-has-children {
394+
flex-direction: column;
395+
}
390396
/* .imap_keyword, .imap_sort, .imap_filter { font-size: 75%; float: left; margin-top: 8px; } */
391397
.imap_keyword {
392398
width: 120px;

modules/imap/site.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ var imap_move_copy = function(e, action, context) {
958958
}
959959
folders.prepend('<div class="move_to_title">'+label+'<a class="close_move_to close" href="#" aria-label="Close"><span aria-hidden="true">&times;</span></a></div>');
960960
$(move_to).html(folders.html());
961-
$('.imap_move_folder_link', move_to).on("click", function() { return expand_imap_move_to_folders($(this).data('target'), context); });
961+
$('.imap_move_folder_link', move_to).on("click", function() { return expand_imap_move_to_folders($(this).data('target'), context, move_to); });
962962
$('a', move_to).not('.imap_move_folder_link').not('.close_move_to').off('click');
963963
$('a', move_to).not('.imap_move_folder_link').not('.close_move_to').on("click", function() { imap_perform_move_copy($(this).data('id'), context); return false; });
964964
$('.move_to_type').val(action);
@@ -1055,31 +1055,30 @@ var imap_perform_move_copy = function(dest_id, context, action = null) {
10551055
}
10561056
};
10571057

1058-
var expand_imap_move_to_mailbox = function(res, context) {
1058+
var expand_imap_move_to_mailbox = function(res, context, move_to) {
10591059
if (res.imap_expanded_folder_path) {
1060-
var move_to = $('.move_to_location');
10611060
var folders = $(res.imap_expanded_folder_formatted);
10621061
folders.find('.manage_folders_li').remove();
1063-
$('.'+Hm_Utils.clean_selector(res.imap_expanded_folder_path), $('.move_to_location')).append(folders);
1062+
$('.'+Hm_Utils.clean_selector(res.imap_expanded_folder_path), move_to).append(folders);
10641063
$('.imap_folder_link', move_to).addClass('imap_move_folder_link').removeClass('imap_folder_link');
10651064
$('.imap_move_folder_link', move_to).off('click');
1066-
$('.imap_move_folder_link', move_to).on("click", function() { return expand_imap_move_to_folders($(this).data('target'), context); });
1065+
$('.imap_move_folder_link', move_to).on("click", function() { return expand_imap_move_to_folders($(this).data('target'), context, move_to); });
10671066
$('a', move_to).not('.imap_move_folder_link').off('click');
10681067
$('a', move_to).not('.imap_move_folder_link').on("click", function() { imap_perform_move_copy($(this).data('id'), context); return false; });
10691068
}
10701069
};
10711070

1072-
var expand_imap_move_to_folders = function(path, context) {
1071+
var expand_imap_move_to_folders = function(path, context, move_to) {
10731072
var detail = Hm_Utils.parse_folder_path(path, 'imap');
1074-
var list = $('.imap_'+detail.server_id+'_'+Hm_Utils.clean_selector(detail.folder), $('.move_to_location'));
1073+
var list = $('.imap_'+detail.server_id+'_'+Hm_Utils.clean_selector(detail.folder), $(move_to));
10751074
if ($('li', list).length === 0) {
10761075
$('.expand_link', list).html('<i class="bi bi-file-minus-fill"></i>');
10771076
if (detail) {
10781077
Hm_Ajax.request(
10791078
[{'name': 'hm_ajax_hook', 'value': 'ajax_imap_folder_expand'},
10801079
{'name': 'imap_server_id', 'value': detail.server_id},
10811080
{'name': 'folder', 'value': detail.folder}],
1082-
function (res) { expand_imap_move_to_mailbox(res, context); }
1081+
function (res) { expand_imap_move_to_mailbox(res, context, move_to); }
10831082
);
10841083
}
10851084
}

0 commit comments

Comments
 (0)