Code Monkey home page Code Monkey logo

Comments (4)

mlshvdv avatar mlshvdv commented on August 18, 2024

👍

from contenttools.

anthonyjb avatar anthonyjb commented on August 18, 2024

Make sense.

I think we may run into the same complications discussed for adding start/stop events #31 - that the event system needs to be overhauled for ContentTools. I'm considering switching to native events but support seems to be sketch at the moment so I'd need to use deprecated interfaces to support for the target browser list currently.

from contenttools.

bfintal avatar bfintal commented on August 18, 2024

Native events are fine, but I don't think it's a required change. For me the main benefit would be a shorter syntax with editor.addEventListener, but aside from that, I don't see any other benefits (let me know if there are others, I'm not a Javascript guru).

Why overhaul the event system?

from contenttools.

anthonyjb avatar anthonyjb commented on August 18, 2024

The ToolUI components now trigger apply and applied events (http://getcontenttools.com/api/content-tools#tool-ui) so it is possible to listen for these events now in the toolbox using:

editor.toolbox()._toolUIs['bold'].addEventListener('apply', function (ev) { ... });

So you can monitor the tools applied by the user and/or changes to the region (using ContentEdit events), what you can't do yet is bind events to the Tool static classes at this time (because they don't inherit from the ComponentUI class). However I'm intending to review this for the next release along with adding additional events now the new event model is in place so this discussion will move to a new issue.

from contenttools.

Related Issues (20)

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.