mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 01:36:13 +00:00
Prevent page to accidentally turn editable on right-click
This commit is contained in:
parent
87814f3751
commit
b879e16e72
1 changed files with 2 additions and 0 deletions
|
@ -217,8 +217,10 @@ cancelEvent(e);
|
|||
function makeEditable(e){
|
||||
//This function allows translators and writers to preview their work.
|
||||
//It works as an easter egg that makes the page editable when user hold their mouse button for one second.
|
||||
if(!e)var e=window.event;
|
||||
switch(e.type){
|
||||
case 'mousedown':
|
||||
if((e.which&&e.which==3)||(e.button&&e.button==2))return;
|
||||
addEvent(document.body,'mouseup',makeEditable);
|
||||
addEvent(document.body,'mousemove',makeEditable);
|
||||
document.body.setAttribute('timeoutEdit',setTimeout(function(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue