mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 17:27:08 +08:00
1 parent
0e423c9713
commit
7bdb03f7bd
12 files changed
+319
-68
No files matched your search
@@ -842,6 +842,12 @@ func changeResource(args []js.Value) (any, error) {
|
||||
case "delete":
|
||||
return currentEditor.DeleteResource(ctx, kind, id)
|
||||
case "bind", "unbind":
|
||||
if kind == "Attachment" {
|
||||
return currentEditor.BindAttachment(ctx, id, args[5].Int(), args[6].String(), action == "bind")
|
||||
}
|
||||
if kind != "Audio" && kind != "Video" {
|
||||
return fmt.Errorf("resource does not support actions")
|
||||
}
|
||||
return currentEditor.BindMedia(ctx, id, args[5].Int(), args[6].String(), action == "bind")
|
||||
case "add", "replace":
|
||||
data, err := bytesFromJS(args[4])
|
||||
|
||||
Reference in new issue
Block a user