From 521f1346380196349c7fdfa8bc07f6895b2c5435 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 29 Jun 2020 21:13:26 +0200 Subject: [PATCH] edge cases: re-enable remember button when creating a new paste, refresh list and disble button upon memorizing the current paste --- js/privatebin.js | 5 +++++ tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 5d3fef8c..49d1c9c3 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -4411,6 +4411,10 @@ jQuery.PrivateBin = (function($, RawDeflate) { } const memory = db.transaction('pastes', 'readwrite').objectStore('pastes'); const request = memory.add(newPaste); + request.onsuccess = function(e) { + me.refreshList(); + $('#rememberbutton').addClass('disabled'); + } return true; }; @@ -4796,6 +4800,7 @@ jQuery.PrivateBin = (function($, RawDeflate) { // show new URL in browser bar history.pushState({type: 'newpaste'}, document.title, url); + $('#rememberbutton').removeClass('disabled'); TopNav.showViewButtons(); diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 8db79fef..4a0a282f 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -72,7 +72,7 @@ endif; ?> - + diff --git a/tpl/page.php b/tpl/page.php index 5aa7abc0..3d767cd7 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -50,7 +50,7 @@ endif; ?> - +