- fixed "lazy" pasting of signatures, closed #397
This commit is contained in:
@@ -2206,12 +2206,15 @@ define([
|
||||
});
|
||||
|
||||
// event listener for global "paste" signatures into the page -------------------------------------------------
|
||||
$(document).off('paste').on('paste', function(e){
|
||||
$('body').off('paste').on('paste', function(e){
|
||||
let targetElement = $(e.target);
|
||||
|
||||
// do not read clipboard if pasting into form elements
|
||||
if(
|
||||
$(e.target).prop('tagName').toLowerCase() !== 'input' &&
|
||||
$(e.target).prop('tagName').toLowerCase() !== 'textarea'
|
||||
targetElement.prop('tagName').toLowerCase() !== 'input' &&
|
||||
targetElement.prop('tagName').toLowerCase() !== 'textarea' || (
|
||||
targetElement.is('input[type="search"]') // Datatables "search" field bubbles `paste.DT` event :(
|
||||
)
|
||||
){
|
||||
let clipboard = (e.originalEvent || e).clipboardData.getData('text/plain');
|
||||
|
||||
|
||||
@@ -2206,12 +2206,15 @@ define([
|
||||
});
|
||||
|
||||
// event listener for global "paste" signatures into the page -------------------------------------------------
|
||||
$(document).off('paste').on('paste', function(e){
|
||||
$('body').off('paste').on('paste', function(e){
|
||||
let targetElement = $(e.target);
|
||||
|
||||
// do not read clipboard if pasting into form elements
|
||||
if(
|
||||
$(e.target).prop('tagName').toLowerCase() !== 'input' &&
|
||||
$(e.target).prop('tagName').toLowerCase() !== 'textarea'
|
||||
targetElement.prop('tagName').toLowerCase() !== 'input' &&
|
||||
targetElement.prop('tagName').toLowerCase() !== 'textarea' || (
|
||||
targetElement.is('input[type="search"]') // Datatables "search" field bubbles `paste.DT` event :(
|
||||
)
|
||||
){
|
||||
let clipboard = (e.originalEvent || e).clipboardData.getData('text/plain');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user