Better MDEditor API with dynamic initialization to fully support lists. (look at window.MDEditors) (#239)

This commit is contained in:
Djamil Legato
2015-11-24 17:39:20 -08:00
parent 4c66c4025a
commit 300c6842de
2 changed files with 49 additions and 22 deletions

View File

@@ -490,6 +490,14 @@ $(function () {
holder.append(newItem);
button.data('key-index', ++key);
// process markdown editors
var field = newItem.find('[name]').filter('textarea'),
name = field.attr('name');
if (field.length && field.data('grav-mdeditor') && typeof MDEditors !== 'undefined') {
MDEditors.add(field);
}
});
});