EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Pierre on February 27, 2020, 01:50:59 AM



Title: [SOLVED] Right menu on TextEditor extension
Post by: Pierre on February 27, 2020, 01:50:59 AM
Hello
I disable usage of context menu because I use my own:

Code:
 
$(document).bind('contextmenu',function(e){
  e.preventDefault();  
});  

now I need to enable default context menu on Texteditor extension.
How to do that?
I try this:

Code:
var t = $(e.target).closest('#texteditor,.texteditor');
if (!t.length){
  e.preventDefault();    
}

but it does not work.
Thank you



Title: Re: Right menu on TextEditor extension
Post by: Pierre on February 27, 2020, 12:10:34 PM
Please?


Title: Re: Right menu on TextEditor extension
Post by: stworthy on February 27, 2020, 11:28:07 PM
The code below works fine.
Code:
$(document).bind('contextmenu',function(e){
    var t = $(e.target).closest('.texteditor');
    if (!t.length){
        e.preventDefault(); 
    }
 
});


Title: Re: Right menu on TextEditor extension
Post by: Pierre on February 28, 2020, 12:41:56 AM
Yes it works, thank you.
I have many places where I use texteditor and I have not used right one  >:(