Move editor.getValue from compiler to app

pull/1/head
Alex Beregszaszi 8 years ago
parent b3831e8bc4
commit ca0bcc5a55
  1. 7
      src/app.js
  2. 6
      src/app/compiler.js

@ -518,7 +518,12 @@ var run = function () {
if (compileTimeout) { if (compileTimeout) {
window.clearTimeout(compileTimeout) window.clearTimeout(compileTimeout)
} }
compileTimeout = window.setTimeout(compiler.compile, 300) compileTimeout = window.setTimeout(function () {
var files = {}
files[utils.fileNameFromKey(editor.getCacheFile())] = editor.getValue()
compiler.compile(files)
}, 300)
} }
editor.onChangeSetup(editorOnChange) editor.onChangeSetup(editorOnChange)

@ -39,12 +39,8 @@ function Compiler (editor, handleImportCall) {
}) })
} }
var compile = function () { var compile = function (files) {
self.event.trigger('compilationStarted', []) self.event.trigger('compilationStarted', [])
var input = editor.getValue()
var files = {}
files[utils.fileNameFromKey(editor.getCacheFile())] = input
internalCompile(files) internalCompile(files)
} }
this.compile = compile this.compile = compile

Loading…
Cancel
Save