Skip to content
Snippets Groups Projects
Commit b61a9040 authored by Oleksandr Kuzava's avatar Oleksandr Kuzava
Browse files

Imrpove yaml editor.

parent 28105902
No related branches found
No related tags found
No related merge requests found
......@@ -2,13 +2,13 @@
'use strict';
var source = '//cdnjs.cloudflare.com/ajax/libs/ace/1.2.0/ace.min.js';
var source = '//cdnjs.cloudflare.com/ajax/libs/ace/1.11.2/ace.min.js';
Drupal.behaviors.yamlEditor = {
attach: function (context) {
attach: function () {
var initEditor = function () {
once('yaml-editor', $(context).find('textarea[data-yaml-editor]')).each(function () {
var $textarea = $(this);
once('yaml-editor', $('textarea[data-yaml-editor]')).forEach(function (item) {
var $textarea = $(item);
var $editDiv = $('<div>').insertBefore($textarea);
$textarea.addClass('visually-hidden');
......@@ -16,9 +16,7 @@
// Init ace editor.
var editor = ace.edit($editDiv[0]);
editor.getSession().setValue($textarea.val());
editor.getSession().setMode('ace/mode/yaml');
editor.getSession().setTabSize(2);
editor.setTheme('ace/theme/chrome');
editor.setOptions({
minLines: 3,
maxLines: 20
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment