Reset attachment when clicking new paste

This commit is contained in:
rugk 2020-04-23 11:25:24 +02:00
parent fc1be18cbe
commit 5ece4d2632
No known key found for this signature in database
GPG Key ID: 05D40A636AFAB34D

View File

@ -3695,9 +3695,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
// in any case, remove saved attachment data
AttachmentViewer.removeAttachmentData();
// hide UI for selected files
// our up-to-date jQuery can handle it :)
$fileWrap.find('input').val('');
me.clearAttachmentInput();
AttachmentViewer.clearDragAndDrop();
// pevent '#' from appearing in the URL
@ -4112,6 +4110,19 @@ jQuery.PrivateBin = (function($, RawDeflate) {
}
};
/**
* Clear the attachment input in the top navigation.
*
* @name TopNav.clearAttachmentInput
* @function
*/
me.clearAttachmentInput = function()
{
// hide UI for selected files
// our up-to-date jQuery can handle it :)
$fileWrap.find('input').val('');
};
/**
* returns the currently set expiration time
*
@ -5133,6 +5144,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
Editor.show();
Editor.focusInput();
AttachmentViewer.removeAttachment();
TopNav.clearAttachmentInput();
TopNav.showCreateButtons();