fix(stacks): update web editor to set tab key to insert spaces (#2735)

pull/2745/head
linquize 2019-02-25 09:19:53 +08:00 committed by Anthony Lapenna
parent da44f14e07
commit c152d3f62e
1 changed files with 7 additions and 1 deletions

View File

@ -11,7 +11,13 @@ angular.module('portainer.app')
var codeMirrorYAMLOptions = {
mode: 'text/x-yaml',
gutters: ['CodeMirror-lint-markers'],
lint: true
lint: true,
extraKeys: {
Tab: function(cm) {
var spaces = Array(cm.getOption('indentUnit') + 1).join(' ');
cm.replaceSelection(spaces);
}
}
};
service.applyCodeMirrorOnElement = function(element, yamlLint, readOnly) {