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 #28

Closed
ilikourou opened this issue Jul 30, 2019 · 2 comments
Closed

Events firing when editor loads #28

ilikourou opened this issue Jul 30, 2019 · 2 comments

Comments

@ilikourou
Copy link

Hello,

I am using Froala in a Laravel application, utilising Nova and nova-froala-field package.

Following the instructions of nova-froala-field, 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 "automatically" fired when the page firstly loads. The same happens for image.loaded and image.error events.
Is this the expected behaviour?

Thank you,
Ilias

@casualuser casualuser transferred this issue from froala/wysiwyg-editor Aug 8, 2019
@casualuser
Copy link

@slavarazum
Hi Slava,
It looks like this depends on integration and events handling. Please assist this customer with his question. If it is somehow related to Froala Editor itself then we will be happy to help.

@slavarazum
Copy link
Collaborator

@casualuser
Hi Aleksei.
Already investigated this issue. Nothing special in Nova Froala Field integration. It native froala field behavior.

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

3 participants