javascript - Non Editable and non removable tinymce content -


is there way make content of tinymce editor non-editable + non-removable, know can make div non-editable giving class "mcenoneditable" still can delete it. want avoid delete well.

the issue run (and why not has solved) there great many ways can "deleted". could...

  • press del or bkspace keys
  • use tinymce apis insert/set content overwrite selection includes non-editable section
  • click tinymce toolbar button or menu option insert/overwrite content when selection includes non-editable section
  • copy/paste content editor when selection includes non-editable section

so in reality make non-deletable need address possible situation action overwrite non-editable section along situation key press delete non-editable section.

tinymce offer variety of events keypress, beforesetcontent , change catching edge cases devil in details makes hard.

if want try stop use of bspace , del can capture key presses , @ deleted , stop key press if don't want happen.


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

javascript - Confirm a form & display message if form is valid with JQuery -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -