GithubHelp home page GithubHelp logo

Comments (4)

kross-f avatar kross-f commented on June 2, 2024

I am also having this problem. One part solution I think I've found is using:

        setup : function(ed) {
            ed.on('click', function(e) {
                console.log('Editor was clicked');
            });
        }

However this breaks the binding with ng-model for some reason.

from ui-tinymce.

timjong93 avatar timjong93 commented on June 2, 2024

Thank you, but the binding to ng-model is quite important to us ;)
We ended up using a workaround for this issue, because the event_handler fires on each event and there is no way(yet) to determine which event.

For autosaving we start a timeout on each event of 3 seconds if another event fires before the end of these 3 seconds the timer is reset, if not we save the content to our servers. Using this way the editors content is saved every time 3 seconds after the user stops typing.

Perhaps this is a usefull workaround for you

from ui-tinymce.

kross-f avatar kross-f commented on June 2, 2024

I like that. I may end up switching to that eventually.
The event I was looking for was blur, so what I ultimately did was this (without using this directive):

  tinymce.init({
        selector: "textarea",
        toolbar: "bold italic underline | undo redo | bullist numlist",
        menubar: false,
        statusbar: false,
        setup : function(ed) {
            ed.on('blur', function(e) {
                self.note.noteText = tinymce.activeEditor.getContent();
                self.updateNote(self.note);
            });
        }
    });

Probably not the best solution, but it accomplishes what I was looking for well enough and I haven't seen any issues with it yet. Hopefully this directive could be updated to fix handle_event_callback() someday.

from ui-tinymce.

wesleycho avatar wesleycho commented on June 2, 2024

Looking into this, I believe this is now outdated, as the project is supporting 4.x right now and handle_event_callback is in 3.x.

from ui-tinymce.

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.