Failed to get link to instance of TinyMCE editor

I am using the jQuery plugin for TinyMCE and have difficulty trying to figure out how to refer to an instance after its initialization. My goal is to remove the menu item.

$(document).ready(function () { var el = $('textarea.tinymce').tinymce({ script_url : '../lib/tiny_mce/tiny_mce.js', plugins: "paste,visualchars,customspecialchars,customvariables,customfootnotes", theme : "advanced", theme_advanced_buttons1 : "bullist,|,customspecialchars,customvariables,customfootnotes,|,undo,redo,|,cut,copy,paste", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left" }); console.log(tinyMCE); //undefined since I'm using jquery plugin console.log($(el).tinymce()); $('input[name^="footnote"]').keyup(function () { console.log(editor); }); }); 

This is my initialization code (pay attention to user plugins). I can't figure out what to call tinymce.ui.DropMenu.removeAll () in my jquery tinymce instance

+4
source share
1 answer

This will give you an editor instance:

 tinymce.get($(el).attr('id') || 'content'); 
+2
source

Source: https://habr.com/ru/post/1403479/


All Articles