Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Events firing when editor loads #27

Closed
ilikourou opened this issue Jul 30, 2019 · 1 comment
Closed

Events firing when editor loads #27

ilikourou opened this issue Jul 30, 2019 · 1 comment

Comments

@ilikourou
Copy link

Hello,

Following the instructions, I have created a .js file containing my event handlers:

window.froala = {
    events: {
        'image.inserted': ($img, response) => {
            console.log('inserted');
        }
    }
};

And then loaded this file in NovaServiceProvider::boot method:

Nova::serving(function (\Laravel\Nova\Events\ServingNova $event) {
   Nova::script('froala-event-handlers', public_path('js/froala-event-handlers.js'));
});

So far so good, when an image is inserted in the editor, the event is fired.
However, the event is also fired when the page firstly loads, without even giving focus to the editor. Is this normal behaviour?

@slavarazum
Copy link
Collaborator

I think yes, because images also inserts during field initialization. You can ask this question in official froala editor issue tracker - https://github.com/froala/wysiwyg-editor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants