jquery - Detect righ click on CKEDITOR focus handler -


when attaching focus handlers multiple ckeditor's in loop:

for(i=0; i<editors.length; i++){     ....     ckeditor.instances[editors[i]].on('focus', handlefocus); };  var handlefocus = function(){   console.log("this= ",this); }; 

how can actual "event" in handlefocus function, can skip right click (context menu) clicks, using existing function skipping right clicks inside editor:

var isrightclick = function(event){         switch (event.which) {             case 1: return false;  // left mouse button             case 2: return false;  // middle mouse button             case 3: return true;   // right mouse button             default: return false; // strange mouse!         }     }; 

use provided event data:

var handlefocus = function(ev){   console.log("event= ", ev); }; 

that way can info editor on event fired, cancel event, original event data, ...

this applies event listener attach in ckeditor event model.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -