fix(UI): selectAll button was still keeping alle items in memory

This commit is contained in:
Hivert Quentin
2023-11-22 11:07:58 +01:00
parent aa53524751
commit 1ae02ebd70
2 changed files with 16 additions and 14 deletions

View File

@@ -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;

View File

@@ -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;
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');
});
});
Calendar.$deleteComponents(components).then(function() {
vm.mode.multiple = 0;
$rootScope.$emit('calendars:list');
});
});
}
function openEvent($event, event) {