From a369202c5178035a0fb3f978b92eb6040c8ec3e2 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 5 Apr 2021 13:47:37 +0200 Subject: [PATCH] add missing expiration reset --- js/privatebin.js | 12 +++++++++--- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index c18bdfe..32ed968 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -4156,10 +4156,16 @@ jQuery.PrivateBin = (function($, RawDeflate) { clearAttachmentInput(); $burnAfterReading.prop('checked', burnAfterReadingDefault); $openDiscussion.prop('checked', openDiscussionDefault); - if (openDiscussionDefault) $openDiscussionOption.removeClass('buttondisabled'); - if (burnAfterReadingDefault) $burnAfterReadingOption.removeClass('buttondisabled'); + if (openDiscussionDefault || !burnAfterReadingDefault) $openDiscussionOption.removeClass('buttondisabled'); + if (burnAfterReadingDefault || !openDiscussionDefault) $burnAfterReadingOption.removeClass('buttondisabled'); - // TODO: reset expiration time + pasteExpiration = Model.getExpirationDefault() || pasteExpiration; + $('#pasteExpiration>option').each(function() { + const $this = $(this); + if ($this.val() === pasteExpiration) { + $('#pasteExpirationDisplay').text($this.text()); + } + }); }; /** diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 81bc355..5f2d038 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 c139f9c..0789680 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -50,7 +50,7 @@ endif; ?> - +