From 69f883823aa1df0d6c7c41dee067c41a8351346c Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Thu, 19 Nov 2015 17:58:50 -0800 Subject: [PATCH] Fixed multiple instances of Markdown Editor (fixes #285) --- themes/grav/js/mdeditor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/grav/js/mdeditor.js b/themes/grav/js/mdeditor.js index 4c58b9b6..a1bdc2b2 100644 --- a/themes/grav/js/mdeditor.js +++ b/themes/grav/js/mdeditor.js @@ -530,11 +530,12 @@ // init $(function(){ + var editor; $('textarea[data-grav-mdeditor]').each(function() { - var editor = $(this), obj; + editor = $(this); if (!editor.data('mdeditor')) { - obj = MDEditor(editor, JSON.parse(editor.attr('data-grav-mdeditor') || '{}')); + new MDEditor(editor, JSON.parse(editor.attr('data-grav-mdeditor') || '{}')); } }); })