mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-11 15:56:06 +01:00
Fixed multiple instances of Markdown Editor (fixes #285)
This commit is contained in:
@@ -530,11 +530,12 @@
|
|||||||
|
|
||||||
// init
|
// init
|
||||||
$(function(){
|
$(function(){
|
||||||
|
var editor;
|
||||||
$('textarea[data-grav-mdeditor]').each(function() {
|
$('textarea[data-grav-mdeditor]').each(function() {
|
||||||
var editor = $(this), obj;
|
editor = $(this);
|
||||||
|
|
||||||
if (!editor.data('mdeditor')) {
|
if (!editor.data('mdeditor')) {
|
||||||
obj = MDEditor(editor, JSON.parse(editor.attr('data-grav-mdeditor') || '{}'));
|
new MDEditor(editor, JSON.parse(editor.attr('data-grav-mdeditor') || '{}'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user