From 5803cbdc3f8cafaf6a098c58ea95dc7e38e4d428 Mon Sep 17 00:00:00 2001 From: Daniel Heath Date: Wed, 3 Jan 2018 22:47:13 +1100 Subject: [PATCH] Fade-out items while waiting for a delete to go through --- templates/index.tmpl | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/templates/index.tmpl b/templates/index.tmpl index fba67b5..ff7ff6a 100755 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -52,6 +52,9 @@ body { .pure-menu a { color: #777; } +.deleting { + opacity: 0.5; +} #wrap { position: absolute; top: 50px; @@ -460,17 +463,19 @@ body#pad textarea { $('.deletable').click(function(event) { event.preventDefault(); - var lineNum = $(this).attr('id') - $.ajax({ - url: "/listitem" + '?' + $.param({ - "lineNum": lineNum, - "page": "{{ .Page }}" - }), - type: 'DELETE', - success: function() { - window.location.reload(true); - } - }); + var lineNum = $(this).attr('id'); + + $.ajax({ + url: "/listitem" + '?' + $.param({ + "lineNum": lineNum, + "page": "{{ .Page }}" + }), + type: 'DELETE', + success: function() { + window.location.reload(true); + } + }); + event.target.classList.add('deleting'); });