Skip to content

Commit

Permalink
fix(UI): selectAll button was still keeping alle items in memory
Browse files Browse the repository at this point in the history
  • Loading branch information
QHivert committed Nov 22, 2023
1 parent aa53524 commit 1ae02eb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
5 changes: 3 additions & 2 deletions UI/WebServerResources/js/Mailer/MailboxController.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,10 @@
folder.$selectedMessages = [];
for (; i < length; i++) {
folder.$messages[i].selected = !vm.allSelected;
folder.$selectedMessages.push(folder.$messages[i]);
if(folder.$messages[i].selected)
folder.$selectedMessages.push(folder.$messages[i]);
count++;
}
count += length;
});
vm.allSelected = !vm.allSelected;
vm.mode.multiple = count;
Expand Down
25 changes: 13 additions & 12 deletions UI/WebServerResources/js/Scheduler/CalendarListController.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,20 @@
}

function confirmDeleteSelectedComponents() {
Dialog.confirm(l('Warning'),
l('Are you sure you want to delete the selected components?'),
{ ok: l('Delete') })
.then(function() {
// User confirmed the deletion
var components = _.filter(Component['$' + vm.componentType], function(component) {
return component.selected;
});
Calendar.$deleteComponents(components).then(function() {
vm.mode.multiple = 0;
$rootScope.$emit('calendars:list');
var components = _.filter(Component['$' + vm.componentType], function(component) {
return component.selected;
});
if(components.length > 0)
Dialog.confirm(l('Warning'),
l('Are you sure you want to delete the selected components?'),
{ ok: l('Delete') })
.then(function() {
// User confirmed the deletion
Calendar.$deleteComponents(components).then(function() {
vm.mode.multiple = 0;
$rootScope.$emit('calendars:list');
});
});
});
}

function openEvent($event, event) {
Expand Down

0 comments on commit 1ae02eb

Please sign in to comment.