Additional checks to allow copy paste for input fields

Let's just say Safari is a PITA
This commit is contained in:
Robert Strouse 2023-02-19 14:07:12 -08:00
parent 5ef3e01226
commit e391f5b2b6
2 changed files with 8 additions and 1 deletions

Binary file not shown.

View file

@ -1,4 +1,11 @@
document.oncontextmenu = (event) => { event.preventDefault(); event.stopPropagation(); return false; }
document.oncontextmenu = (event) => {
if (event.target && event.target.tagName.toLowerCase() === 'input' && (event.target.type.toLowerCase() === 'text' || event.target.type.toLowerCase() === 'password'))
return;
else {
event.preventDefault(); event.stopPropagation(); return false;
}
}
Number.prototype.round = function (dec) { return Number(Math.round(this + 'e' + dec) + 'e-' + dec); };
Number.prototype.fmt = function (format, empty) {
if (isNaN(this)) return empty || '';