Try to handle paste focus a bit better

This commit is contained in:
Andre D 2015-06-05 23:53:00 -04:00
parent 4b65753f11
commit 18ce5d3554

View file

@ -93,20 +93,17 @@ $(function () {
g.focusPaste = function () { g.focusPaste = function () {
setTimeout(function () { setTimeout(function () {
pasteCatcher.focus(); pasteCatcher.focus()
pasteCatcher.click()
}, 100); }, 100);
} }
$(document).on('click', function (e) { $(document).on('click', function (e) {
if (e.target == document.body) { if (e.target == document.body && pastearea.is(':visible')) {
e.preventDefault() e.preventDefault()
g.focusPaste(); g.focusPaste();
} }
}) })
g.focusPaste();
$(document).on('paste', function (e) { $(document).on('paste', function (e) {
if (!pastearea.is(':visible')) { if (!pastearea.is(':visible')) {