minor fix bug

This commit is contained in:
Xuan Sang LE
2020-05-21 21:54:43 +02:00
parent 61a0196c79
commit 5c08a189cc
9 changed files with 31 additions and 17 deletions

View File

@ -86,10 +86,8 @@ class BaseModel
@dialog.title = data.title if data and data.title
@dialog.init()
ask: (t, m, f) ->
@._gui.openDialog "YesNoDialog", (d) ->
f() if d
, t, { text: m }
ask: (data) ->
@._gui.openDialog("YesNoDialog", data)
publish: (t, m, e) ->
mt = @meta()

View File

@ -73,10 +73,13 @@ Ant.OS.API.handle =
apigateway: (d, ws) ->
if ws
new Promise (resolve, reject) ->
path = "#{Ant.OS.API.HOST}/system/apigateway?ws=1"
proto = if window.location.protocol is "https:" then "wss://" else "ws://"
socket = new WebSocket proto + path
resolve(socket)
try
path = "#{Ant.OS.API.HOST}/system/apigateway?ws=1"
proto = if window.location.protocol is "https:" then "wss://" else "ws://"
socket = new WebSocket proto + path
resolve(socket)
catch e
reject e
else
path = "#{Ant.OS.API.REST}/system/apigateway?ws=0"
Ant.OS.API.post path, d

View File

@ -52,7 +52,7 @@ class ResizerTag extends Ant.OS.GUI.BaseTag
w = Math.round(e.clientX - offset.left)
w = @minsize if w < @minsize
$(@resizable_el).attr "data-width", w.toString()
@observable.trigger "resize", { id: @resizable_el.aid(), data: w }
@observable.trigger "resize", { id: @aid(), data: { w: w } }
verticalResize: (e) ->
@ -61,7 +61,7 @@ class ResizerTag extends Ant.OS.GUI.BaseTag
h = Math.round(e.clientY - offset.top)
h = @minsize if h < @minsize
$(@resizable_el).attr "data-height", h.toString()
@observable.trigger "resize", { id: @resizable_el.aid(), data: h }
@observable.trigger "resize", { id: @aid(), data: { w: w } }
layout: () ->
[]