Giter Club home page Giter Club logo

Comments (8)

daviferreira avatar daviferreira commented on July 17, 2024

What about listening to the contenteditable events? http://stackoverflow.com/a/7804973

from medium-editor.

jsphpl avatar jsphpl commented on July 17, 2024

Thanks :)
Any plans on the approach?

from medium-editor.

jsphpl avatar jsphpl commented on July 17, 2024

One option would be to specify callbacks via the init function.
Or Another option: simply emit signals, that can be catched separately.

from medium-editor.

daviferreira avatar daviferreira commented on July 17, 2024

Yeah, I think we should go with custom events.

from medium-editor.

jsphpl avatar jsphpl commented on July 17, 2024

So i will make execAction() emit an event (called 'medium-editor-action' ?) with the action as event data.
Is this the right place to emit that signal? Should we rather emit different events for each action?

from medium-editor.

beshur avatar beshur commented on July 17, 2024

Sorry, guys, are there an events for editor show/hide?

from medium-editor.

daviferreira avatar daviferreira commented on July 17, 2024

Not yet, pull request is welcome :)

from medium-editor.

nmielnik avatar nmielnik commented on July 17, 2024

@bergie we now have a 'contentEditable' event that fires when the content has changed, this is supported in all our browsers as well.

You can subscribe to this custom event via the subscribe() method:

var editor = new MediumEditor('.editor',);
editor.subscribe('editableInput', function (event, editorElement) {
  // event handling here
});

@beshur we have optional onShowToolbar and onHideToolbar callbacks that can be passed in as options when instantiating the editor. These will be called each time the toolbar is shown and displayed:

var editor = new MediumEditor('.editor', {
  onShowToolbar: function () { // handling show },
  onHideToolbar: function () { // handling hide }
});

Now that you mention it, it seems like this should be a custom event, I'll look into supporting this in the future.

from medium-editor.

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.