From 9f02df0b314b29937b5bfb219dcd24063d3eca77 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 21 Dec 2020 16:02:53 +0100 Subject: [PATCH] Correctly move tickets after closing them --- www/admin/app-admin.less | 10 ++++++---- www/admin/inner.js | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/www/admin/app-admin.less b/www/admin/app-admin.less index 9f2c950a0..77e13af43 100644 --- a/www/admin/app-admin.less +++ b/www/admin/app-admin.less @@ -89,10 +89,6 @@ .cp-support-list-actions { margin: 10px 0px 10px 2px; - .cp-support-close { - order: 20; - margin-left: auto !important; - } } .cp-support-list-ticket { @@ -119,6 +115,12 @@ } .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 { &:last-child:not(.cp-support-fromadmin) { color: @colortheme_cp-red; diff --git a/www/admin/inner.js b/www/admin/inner.js index eabd997ff..755b60ddc 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -767,6 +767,7 @@ define([ if (!$ticket.length) { return; } $ticket.addClass('cp-support-list-closed'); $ticket.append(APP.support.makeCloseMessage(content, hash)); + reorder(); return; } if (msg.type !== 'TICKET') { return; } @@ -787,7 +788,12 @@ define([ })); }); }).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 hideButton.removeAttribute('disabled'); // and show a generic error message