Coder Social home page Coder Social logo

csga5000 / tinymce-prevent-delete Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 16.0 26 KB

This is meant to work with tinymce's noneditable plugin and will prevent the deletion of non-editable elements

License: GNU Affero General Public License v3.0

JavaScript 100.00%

tinymce-prevent-delete's People

Contributors

chaseguru avatar csga5000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tinymce-prevent-delete's Issues

Shouldn't look at children for this.check

Thanks for this plugin! Save me time in my project.

I noticed a bug. Say I have a paragraph and inside the paragraph, I have a mceNonEditable span at the end. With the current code, if you put the cursor at the very end fo the paragraph, it won't let you press enter to start a new paragraph, even though this wouldn't affect the span.

I believe this is caused by this.check code. It calls this.checkChildren to see if any children have mceNonEditable. The problem is, this is reversed logic. It makes the p element return as mceNonEditable just because it has an inline span that is mceNonEditable as a child.

TinyMCE doesn't support nesting editable components so at whatever element you set mceNonEditable on, all children are non-editable. The code should therefore check parents, that way if say a element was inside the it would still prevent a delete.

Stability

First of all, thank you very much to publish this plugin so we all can use it. I would like to know, in a scale from 1 to 10, how stable do you think this plugin is today for production use?

thanks :-)
Fernando

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.