From 4b79308119b3bdce3535d252e7d3414988423470 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 22 Feb 2018 13:36:31 -0800 Subject: [PATCH] Move 0-item clipboard collapser to update_clipboard_tray. --- frontends/etiquette_flask/static/photoclipboard.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontends/etiquette_flask/static/photoclipboard.js b/frontends/etiquette_flask/static/photoclipboard.js index b91df5a..184079b 100644 --- a/frontends/etiquette_flask/static/photoclipboard.js +++ b/frontends/etiquette_flask/static/photoclipboard.js @@ -170,10 +170,6 @@ function on_tray_delete_button(event) var clipboard_line = event.target.parentElement; var photo_id = clipboard_line.dataset.id; photo_clipboard.delete(photo_id); - if (photo_clipboard.size == 0) - { - clipboard_tray_collapse(); - } save_photo_clipboard(); } @@ -188,6 +184,11 @@ function update_clipboard_tray() return; } + if (photo_clipboard.size == 0) + { + clipboard_tray_collapse(); + } + var tray_lines = document.getElementById("clipboard_tray_lines"); if (!clipboard_tray.classList.contains("hidden")) {