Vanderson Dill
Vanderson Dill

Reputation: 181

Summernote click event?

How can I handle summernote click event? I want to handle cursor position when changing by mouse click. There is a onFocus callback, but when editor already has focus, I can't found a solution.

I want to do something like this:

callbacks: {
    onKeydown: function (e) {
        $('#summernote').summernote('editor.saveRange');
    },
    onClick: function (e) {
        $('#summernote').summernote('editor.saveRange');
    }

Upvotes: 2

Views: 4551

Answers (2)

Doberman Pharaoh
Doberman Pharaoh

Reputation: 21

It's worked for me:

$('#summernote').summernote({

    callbacks: {
        onInit: function() {
            $(".note-editable").on('click', function (e) {
                console.log('clicked');
            });
        }
    }

});

Upvotes: 2

Vanderson Dill
Vanderson Dill

Reputation: 181

I've came with this solution:

$scope.summernoteOptions = {
    onInit: function () {
        $(".note-editable").on('click', '.cssTargetClass', function (e) {});
            }
        }
    };

Where cssTargetClass is the class of the type of elements that I want to bind to event.

Upvotes: 2

Related Questions