mudrd8mz / moodle-editor_marklar

Markdown friendly editor for Moodle
GNU General Public License v3.0
17 stars 3 forks source link

Undefined fpoptions prevents Marklar from loading #19

Open juancs opened 4 years ago

juancs commented 4 years ago

I've been facing a problem where, sometimes, Marklar doesn't loads in the page.

The init function int the amd module uses M.editor_marklar. js_init_code is put in the page after the init call leading to a race condition: sometimes M.editor_marklar is defined, sometimes it isn't.

With this patch, M.editor_marklar is initialized just before the init function gets called.

mudrd8mz commented 3 years ago

Well spotted @juancs - and thanks for the patch! I'll try to reproduce this and debug a bit more. Maybe this is a good opportunity to actually modernise the whole JS loading to match the latest moodledev guidelines.