Fix for code editor modelist

This commit is contained in:
NGPixel 2017-04-02 00:22:52 -04:00
parent fe0c4ce0c0
commit feed55f1d1
3 changed files with 235 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@ import _ from 'lodash'
import * as ace from 'brace'
import 'brace/theme/tomorrow_night'
import 'brace/mode/markdown'
import 'brace-ext-modelist'
let codeEditor = null
@ -31,7 +32,7 @@ let loadAceMode = (m) => {
// Vue Code Block instance
module.exports = (mde, mdeModalOpenState) => {
let modelist = {} // ace.require('ace/ext/modelist')
let modelist = ace.acequire('ace/ext/modelist')
let vueCodeBlock = new Vue({
el: '#modal-editor-codeblock',
data: {
@ -42,7 +43,7 @@ module.exports = (mde, mdeModalOpenState) => {
watch: {
modeSelected: (val, oldVal) => {
loadAceMode(val).done(() => {
ace.require('ace/mode/' + val)
ace.acequire('ace/mode/' + val)
codeEditor.getSession().setMode('ace/mode/' + val)
})
}

View File

@ -30,7 +30,7 @@ const args = require('yargs')
// Define aliases
const ALIASES = {
'ace': 'ace-builds/src-min-noconflict/ace.js',
'brace-ext-modelist': 'brace/ext/modelist.js',
'simplemde': 'simplemde/dist/simplemde.min.js',
'socket.io-client': 'socket.io-client/dist/socket.io.min.js',
'vue': 'vue/dist/vue.js'