TinyMCE:API/tinymce.Editor/onContextMenu

From Moxiecode Documentation Wiki

Jump to: navigation, search

Contents

Event: onContextMenu

Summary

This event gets executed when the user pressed down the right mouse button or ctrl+click on Mac.

Syntax

event_callback(<tinymce.Editor> ed, <Event> e)

Parameters

ed
Sender object/Editor instance that the event occurred in.
e
DOM Event object, includes things like target for the event.

Examples

// Adds an observer to the onContextMenu event using tinyMCE.init
tinyMCE.init({
   ...
   setup : function(ed) {
      ed.onContextMenu.add(function(ed, e) {
           console.debug('Context menu event:' + e.target);
      });
   }
});

// Adds an observer to the onContextMenu event using the render method
var ed = new tinymce.Editor('someid', {
   .. Some settings
});

ed.onContextMenu.add(function(ed, e) {
   console.debug('Context menu event:' + e.target);
});

ed.render();
Personal tools