mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-20 05:33:17 -04:00
Fixed adding attachments from clipboard
This commit is contained in:
parent
e38b88c12c
commit
0ce8627561
2 changed files with 11 additions and 10 deletions
|
@ -3421,16 +3421,17 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
function addClipboardEventHandler() {
|
||||
$(document).on('paste', function (event) {
|
||||
const items = (event.clipboardData || event.originalEvent.clipboardData).items;
|
||||
const lastItem = items[items.length - 1];
|
||||
if (lastItem.kind === 'file') {
|
||||
const files = [...items]
|
||||
.filter(item => item.kind === 'file')
|
||||
.map(item => item.getAsFile());
|
||||
|
||||
if (TopNav.isAttachmentReadonly()) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
return false;
|
||||
} else {
|
||||
readFileData(lastItem.getAsFile());
|
||||
}
|
||||
}
|
||||
|
||||
readFileData(files);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ class Configuration
|
|||
'js/kjua-0.9.0.js' => 'sha512-CVn7af+vTMBd9RjoS4QM5fpLFEOtBCoB0zPtaqIDC7sF4F8qgUSRFQQpIyEDGsr6yrjbuOLzdf20tkHHmpaqwQ==',
|
||||
'js/legacy.js' => 'sha512-UxW/TOZKon83n6dk/09GsYKIyeO5LeBHokxyIq+r7KFS5KMBeIB/EM7NrkVYIezwZBaovnyNtY2d9tKFicRlXg==',
|
||||
'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
|
||||
'js/privatebin.js' => 'sha512-lP3oQM8eZ6HNCUUZC2HvmNTO3RRNw7WPCCWbVVr0e9DHvgprYr6tYtDYzmWdpD6rzjHOgekHhFMO8LIO9ufyug==',
|
||||
'js/privatebin.js' => 'sha512-ET6BA8TNB62Rm2aM6EKp8nEGsU8+fggmaZ3aWddwEP1SaThWisIOZFKMcaLs7ztcH8Ye89H6+bzJ+/Uy8hkCMQ==',
|
||||
'js/purify-3.2.6.js' => 'sha512-zqwL4OoBLFx89QPewkz4Lz5CSA2ktU+f31fuECkF0iK3Id5qd3Zpq5dMby8KwHjIEpsUgOqwF58cnmcaNem0EA==',
|
||||
'js/rawinflate-0.3.js' => 'sha512-g8uelGgJW9A/Z1tB6Izxab++oj5kdD7B4qC7DHwZkB6DGMXKyzx7v5mvap2HXueI2IIn08YlRYM56jwWdm2ucQ==',
|
||||
'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue