Update integration to use bundled version of CascadeStudio
resolves #139
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { initialize, getEditor } from 'src/cascade/js/MainPage/CascadeMain'
|
||||
import { initialize } from 'src/cascade/js/MainPage/CascadeMain'
|
||||
import { monacoEditor } from 'src/cascade/js/MainPage/CascadeState'
|
||||
|
||||
class CascadeController {
|
||||
_hasInitialised = false
|
||||
@@ -9,14 +10,14 @@ class CascadeController {
|
||||
|
||||
initialise(onCodeChange, code) {
|
||||
const onInit = () => {
|
||||
const editor = getEditor()
|
||||
const editor = monacoEditor
|
||||
editor.setValue(code)
|
||||
editor.evaluateCode(false)
|
||||
}
|
||||
// only inits on first call, after that it just updates the editor and revaluates code, maybe should rename?
|
||||
this.incomingOnCodeChang = onCodeChange
|
||||
if (!this._hasInitialised) {
|
||||
initialize(this.controllerOnCodeChange, code, onInit)
|
||||
new initialize(this.controllerOnCodeChange, code, onInit)
|
||||
this._hasInitialised = true
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user