Sha256: 51521e0730cda457c80fb4bd8d7a6778e3a08567b9f14c9d7fd4393d58547b25
Contents?: true
Size: 770 Bytes
Versions: 15
Compression:
Stored size: 770 Bytes
Contents
function codemirrorify(el) { return CodeMirror.fromTextArea(el, { theme: "neo", lineNumbers: true, viewportMargin: Infinity, mode: "fluentd" }); } $(function(){ $('.js-fluentd-config-editor').each(function(_, el){ codemirrorify(el); }); }); Vue.directive('config-editor', { bind: function(){ var $parent = this.vm; // NOTE: needed delay for waiting CodeMirror setup _.delay(function(textarea){ var cm = codemirrorify(textarea); // textarea.codemirror = cm; // for test, but doesn't work for now (working on Chrome, but Poltergeist not) cm.on('change', function(code_mirror){ // bridge Vue - CodeMirror world $parent.editContent = code_mirror.getValue(); }); }, 0, this.el); } });
Version data entries
15 entries across 15 versions & 1 rubygems