PHP Classes

File: public/js/tinymce/src/plugins/toc/src/main/js/core/FilterContent.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/toc/src/main/js/core/FilterContent.js   Download  
File: public/js/tinymce/src/plugins/toc/src/main/js/core/FilterContent.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 1,029 bytes
 

Contents

Class file image Download
/** * FilterContent.js * * Released under LGPL License. * Copyright (c) 1999-2017 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ define( 'tinymce.plugins.toc.core.FilterContent', [ 'tinymce.plugins.toc.api.Settings' ], function (Settings) { var setup = function (editor) { var $ = editor.$, tocClass = Settings.getTocClass(editor); editor.on('PreProcess', function (e) { var $tocElm = $('.' + tocClass, e.node); if ($tocElm.length) { $tocElm.removeAttr('contentEditable'); $tocElm.find('[contenteditable]').removeAttr('contentEditable'); } }); editor.on('SetContent', function () { var $tocElm = $('.' + tocClass); if ($tocElm.length) { $tocElm.attr('contentEditable', false); $tocElm.children(':first-child').attr('contentEditable', true); } }); }; return { setup: setup }; } );