From 0cf8335184e0500aa5c0373781daa4829987cf88 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 2 Jan 2018 12:34:03 +0100 Subject: [PATCH] Add a refresh button for convenience --- static/js/wishlists.js | 13 +++++++++++++ templates/index.html.tera | 3 +++ 2 files changed, 16 insertions(+) diff --git a/static/js/wishlists.js b/static/js/wishlists.js index e92c7bc..757191d 100644 --- a/static/js/wishlists.js +++ b/static/js/wishlists.js @@ -155,6 +155,19 @@ function enableListEditMode(listElem) { } $(function() { + $('.lists-refresh').on('click', function() { + if ($(".list-data:visible").length) { + showErrorDialog("Kan niet verversen tijdens bewerken!", + "

Het is niet mogelijk om de lijsten te verversen als er " + + "op dit moment een lijst bewerkt wordt.

" + + "

Sla te lijst die bewerkt wordt eerst op of annuleer de " + + "bewerking.", + true); + } else { + initLists(); + } + }); + $('.list-cancel-button').on('click', function() { var listElem = $(this).parents(".list"); console.debug("Cancelling the edit of list " + listElem.data("list-id")); diff --git a/templates/index.html.tera b/templates/index.html.tera index bcb5a44..2ae7725 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -9,6 +9,9 @@ {% endfor %} + {% endblock navbar %}