mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2025-12-13 11:02:12 +01:00
Additional checks to allow copy paste for input fields
Let's just say Safari is a PITA
This commit is contained in:
parent
5ef3e01226
commit
e391f5b2b6
2 changed files with 8 additions and 1 deletions
|
|
@ -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 || '';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue