mirror of
https://github.com/lxsang/antos-frontend.git
synced 2024-12-28 10:18:21 +01:00
minor fix
This commit is contained in:
parent
5c5517e685
commit
a111162e7b
@ -77,9 +77,9 @@ class BaseModel
|
|||||||
@dialog.title = title
|
@dialog.title = title
|
||||||
@dialog.init()
|
@dialog.init()
|
||||||
|
|
||||||
publish: (t, m) ->
|
publish: (t, m, e) ->
|
||||||
mt = @meta()
|
mt = @meta()
|
||||||
_courrier.trigger t, { id: @pid, name: @name, data: { m: m, icon: mt.icon, iconclass: mt.iconclass } }
|
_courrier.trigger t, { id: @pid, name: @name, data: { m: m, icon: mt.icon, iconclass: mt.iconclass }, error: e }
|
||||||
|
|
||||||
notify: (m) ->
|
notify: (m) ->
|
||||||
@publish "notification", m
|
@publish "notification", m
|
||||||
@ -88,7 +88,7 @@ class BaseModel
|
|||||||
@publish "warning", m
|
@publish "warning", m
|
||||||
|
|
||||||
error: (m) ->
|
error: (m) ->
|
||||||
@publish "error", m + (@_api.throwe @name)
|
@publish "error", m, (@_api.throwe @name)
|
||||||
|
|
||||||
fail: (m) ->
|
fail: (m) ->
|
||||||
@publish "fail", m
|
@publish "fail", m
|
||||||
|
@ -178,12 +178,18 @@ class GraphEditor extends this.OS.GUI.BaseApplication
|
|||||||
renderSVG: (silent) ->
|
renderSVG: (silent) ->
|
||||||
me = @
|
me = @
|
||||||
id = Math.floor(Math.random() * 100000) + 1
|
id = Math.floor(Math.random() * 100000) + 1
|
||||||
if silent
|
#if silent
|
||||||
mermaid.parseError = (e, h) ->
|
# mermaid.parseError = (e, h) ->
|
||||||
else
|
#else
|
||||||
mermaid.parseError = (e, h) ->
|
# mermaid.parseError = (e, h) ->
|
||||||
me.error e
|
# me.error e
|
||||||
mermaid.render "c#{id}", @editor.getValue(), (text, f) ->
|
text = @editor.getValue()
|
||||||
|
try
|
||||||
|
mermaid.parse text
|
||||||
|
catch e
|
||||||
|
me.error __("Syntax error: {0}", e.str) if not silent
|
||||||
|
return
|
||||||
|
mermaid.render "c#{id}", text, (text, f) ->
|
||||||
me.preview.innerHTML = text
|
me.preview.innerHTML = text
|
||||||
$(me.preview).append me.btctn
|
$(me.preview).append me.btctn
|
||||||
me.calibrate()
|
me.calibrate()
|
||||||
|
Loading…
Reference in New Issue
Block a user