Correctly move tickets after closing them

pull/1/head
yflory 4 years ago
parent 7e1c7c481e
commit 9f02df0b31

@ -89,10 +89,6 @@
.cp-support-list-actions { .cp-support-list-actions {
margin: 10px 0px 10px 2px; margin: 10px 0px 10px 2px;
.cp-support-close {
order: 20;
margin-left: auto !important;
}
} }
.cp-support-list-ticket { .cp-support-list-ticket {
@ -119,6 +115,12 @@
} }
.cp-support-list-ticket:not(.cp-support-list-closed) { .cp-support-list-ticket:not(.cp-support-list-closed) {
.cp-support-list-actions {
.cp-button-confirm, .cp-support-close {
order: 20;
margin-left: auto !important;
}
}
.cp-support-list-message { .cp-support-list-message {
&:last-child:not(.cp-support-fromadmin) { &:last-child:not(.cp-support-fromadmin) {
color: @colortheme_cp-red; color: @colortheme_cp-red;

@ -767,6 +767,7 @@ define([
if (!$ticket.length) { return; } if (!$ticket.length) { return; }
$ticket.addClass('cp-support-list-closed'); $ticket.addClass('cp-support-list-closed');
$ticket.append(APP.support.makeCloseMessage(content, hash)); $ticket.append(APP.support.makeCloseMessage(content, hash));
reorder();
return; return;
} }
if (msg.type !== 'TICKET') { return; } if (msg.type !== 'TICKET') { return; }
@ -787,7 +788,12 @@ define([
})); }));
}); });
}).nThen(function () { }).nThen(function () {
if (!error) { return void $ticket.remove(); } if (!error) {
$ticket.remove();
delete hashesById[id];
reorder();
return;
}
// if deletion failed then reactivate the button and warn // if deletion failed then reactivate the button and warn
hideButton.removeAttribute('disabled'); hideButton.removeAttribute('disabled');
// and show a generic error message // and show a generic error message

Loading…
Cancel
Save