Reset checkboxes on new paste

This commit is contained in:
rugk 2020-04-23 12:07:08 +02:00
parent 5ece4d2632
commit d3ba7eeb13
No known key found for this signature in database
GPG Key ID: 05D40A636AFAB34D

View File

@ -3601,6 +3601,20 @@ jQuery.PrivateBin = (function($, RawDeflate) {
}
}
/**
* Clear the attachment input in the top navigation.
*
* @name TopNav.clearAttachmentInput
* @function
*/
function clearAttachmentInput()
{
// hide UI for selected files
// our up-to-date jQuery can handle it :)
$fileWrap.find('input').val('');
}
/**
* return raw text
*
@ -3695,7 +3709,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
// in any case, remove saved attachment data
AttachmentViewer.removeAttachmentData();
me.clearAttachmentInput();
clearAttachmentInput();
AttachmentViewer.clearDragAndDrop();
// pevent '#' from appearing in the URL
@ -4111,16 +4125,21 @@ jQuery.PrivateBin = (function($, RawDeflate) {
};
/**
* Clear the attachment input in the top navigation.
* Reset the top navigation back to it's default values.
*
* @name TopNav.clearAttachmentInput
* @name TopNav.resetInput
* @function
*/
me.clearAttachmentInput = function()
me.resetInput = function()
{
// hide UI for selected files
// our up-to-date jQuery can handle it :)
$fileWrap.find('input').val('');
clearAttachmentInput();
$openDiscussion.prop('checked', false);
$burnAfterReading.prop('checked', false);
$openDiscussionOption.removeClass('buttondisabled');
$burnAfterReadingOption.removeClass('buttondisabled');
// TODO: reset expiration time
};
/**
@ -5144,7 +5163,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
Editor.show();
Editor.focusInput();
AttachmentViewer.removeAttachment();
TopNav.clearAttachmentInput();
TopNav.resetInput();
TopNav.showCreateButtons();