From 5ec20c1bc289c0f80dddc2112c98c7bccf963c30 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Thu, 11 Aug 2016 11:31:34 +0200 Subject: [PATCH] making burn-after-reading and discussion mutually exclusive options to improve UI, resolves #11 --- js/privatebin.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/js/privatebin.js b/js/privatebin.js index 8244c13..2fb8a62 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -1201,6 +1201,23 @@ $(function() { } }, + /** + * If discussion is checked, disable "burn after reading". + */ + changeOpenDisc: function() + { + if (this.openDiscussion.is(':checked') ) + { + this.burnAfterReadingOption.addClass('buttondisabled'); + this.burnAfterReading.attr({checked: false, disabled: true}); + } + else + { + this.burnAfterReadingOption.removeClass('buttondisabled'); + this.burnAfterReading.removeAttr('disabled'); + } + }, + /** * Reload the page. * @@ -1419,6 +1436,7 @@ $(function() { bindEvents: function() { this.burnAfterReading.change($.proxy(this.changeBurnAfterReading, this)); + this.openDisc.change($.proxy(this.changeOpenDisc, this)); this.sendButton.click($.proxy(this.sendData, this)); this.cloneButton.click($.proxy(this.clonePaste, this)); this.rawTextButton.click($.proxy(this.rawText, this));