ZwiiCMS/core/vendor/codemirror/init.js

18 lines
375 B
JavaScript
Raw Normal View History

2018-04-02 08:29:19 +02:00
/**
* Initialisation de CodeMirror
*/
$(function() {
$(".editor").each(function() {
2018-04-02 08:29:19 +02:00
var _this = this;
// Initialisation de CodeMirror
var codeMirror = CodeMirror.fromTextArea(_this, {
lineNumbers: true,
});
// Mise à jour de la textarea
codeMirror.on("change", function() {
$(_this)
.val(codeMirror.getValue())
.trigger("change");
});
});
});