mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 06:19:41 +02:00
22 lines
470 B
JavaScript
22 lines
470 B
JavaScript
|
angular.module('portainer.services')
|
||
|
.factory('CodeMirrorService', function CodeMirrorService() {
|
||
|
'use strict';
|
||
|
|
||
|
var codeMirrorOptions = {
|
||
|
lineNumbers: true,
|
||
|
mode: 'text/x-yaml',
|
||
|
gutters: ['CodeMirror-lint-markers'],
|
||
|
lint: true
|
||
|
};
|
||
|
|
||
|
var service = {};
|
||
|
|
||
|
service.applyCodeMirrorOnElement = function(element) {
|
||
|
var cm = CodeMirror.fromTextArea(element, codeMirrorOptions);
|
||
|
cm.setSize('100%', 500);
|
||
|
return cm;
|
||
|
};
|
||
|
|
||
|
return service;
|
||
|
});
|