debian-mirror-gitlab/app/assets/javascripts/blob/utils.js

21 lines
382 B
JavaScript
Raw Normal View History

2020-04-08 14:13:33 +05:30
import Editor from '~/editor/editor_lite';
2020-10-24 23:57:45 +05:30
export function initEditorLite({ el, ...args }) {
2020-04-08 14:13:33 +05:30
if (!el) {
throw new Error(`"el" parameter is required to initialize Editor`);
}
2020-10-24 23:57:45 +05:30
const editor = new Editor({
scrollbar: {
alwaysConsumeMouseWheel: false,
},
});
2020-05-24 23:13:21 +05:30
editor.createInstance({
el,
2020-10-24 23:57:45 +05:30
...args,
2020-05-24 23:13:21 +05:30
});
2020-04-08 14:13:33 +05:30
return editor;
}
export default () => ({});