@@ -127,10 +127,10 @@ function eventTarget(event) {
127
127
document . addEventListener ( "DOMContentLoaded" , ( ) => {
128
128
} ) ;
129
129
window . addEventListener ( "contextmenu" , contextMenuHandler ) ;
130
- const call$1 = newRuntimeCaller ( objectNames . ContextMenu ) ;
130
+ const call$2 = newRuntimeCaller ( objectNames . ContextMenu ) ;
131
131
const ContextMenuOpen = 0 ;
132
132
function openContextMenu ( id , x , y , data ) {
133
- void call$1 ( ContextMenuOpen , { id, x, y, data } ) ;
133
+ void call$2 ( ContextMenuOpen , { id, x, y, data } ) ;
134
134
}
135
135
function contextMenuHandler ( event ) {
136
136
const target = eventTarget ( event ) ;
@@ -1138,7 +1138,7 @@ if (promiseWithResolvers && typeof promiseWithResolvers === "function") {
1138
1138
window . _wails = window . _wails || { } ;
1139
1139
window . _wails . callResultHandler = resultHandler ;
1140
1140
window . _wails . callErrorHandler = errorHandler ;
1141
- const call = newRuntimeCaller ( objectNames . Call ) ;
1141
+ const call$1 = newRuntimeCaller ( objectNames . Call ) ;
1142
1142
const cancelCall = newRuntimeCaller ( objectNames . CancelCall ) ;
1143
1143
const callResponses = /* @__PURE__ */ new Map ( ) ;
1144
1144
const CallBinding = 0 ;
@@ -1224,7 +1224,7 @@ function Call(options) {
1224
1224
const id = generateID ( ) ;
1225
1225
const result = CancellablePromise . withResolvers ( ) ;
1226
1226
callResponses . set ( id , { resolve : result . resolve , reject : result . reject } ) ;
1227
- const request = call ( CallBinding , Object . assign ( { "call-id" : id } , options ) ) ;
1227
+ const request = call$1 ( CallBinding , Object . assign ( { "call-id" : id } , options ) ) ;
1228
1228
let running = false ;
1229
1229
request . then ( ( ) => {
1230
1230
running = true ;
@@ -1283,7 +1283,8 @@ function listenerOff(listener) {
1283
1283
}
1284
1284
window . _wails = window . _wails || { } ;
1285
1285
window . _wails . dispatchWailsEvent = dispatchWailsEvent ;
1286
- newRuntimeCaller ( objectNames . Events ) ;
1286
+ const call = newRuntimeCaller ( objectNames . Events ) ;
1287
+ const EmitMethod = 0 ;
1287
1288
class WailsEvent {
1288
1289
constructor ( name , data = null ) {
1289
1290
this . name = name ;
@@ -1316,6 +1317,9 @@ function OnMultiple(eventName, callback, maxCallbacks) {
1316
1317
function On ( eventName , callback ) {
1317
1318
return OnMultiple ( eventName , callback , - 1 ) ;
1318
1319
}
1320
+ function Emit ( event ) {
1321
+ return call ( EmitMethod , event ) ;
1322
+ }
1319
1323
window . _wails = window . _wails || { } ;
1320
1324
window . _wails . invoke = invoke ;
1321
1325
invoke ( "wails:runtime:ready" ) ;
@@ -1329,6 +1333,8 @@ function SetBadge(label) {
1329
1333
}
1330
1334
const setButton = document . getElementById ( "set" ) ;
1331
1335
const removeButton = document . getElementById ( "remove" ) ;
1336
+ const setButtonUsingGo = document . getElementById ( "set-go" ) ;
1337
+ const removeButtonUsingGo = document . getElementById ( "remove-go" ) ;
1332
1338
const labelElement = document . getElementById ( "label" ) ;
1333
1339
const timeElement = document . getElementById ( "time" ) ;
1334
1340
setButton . addEventListener ( "click" , ( ) => {
@@ -1338,6 +1344,16 @@ setButton.addEventListener("click", () => {
1338
1344
removeButton . addEventListener ( "click" , ( ) => {
1339
1345
RemoveBadge ( ) ;
1340
1346
} ) ;
1347
+ setButtonUsingGo . addEventListener ( "click" , ( ) => {
1348
+ let label = labelElement . value ;
1349
+ void Emit ( {
1350
+ name : "set:badge" ,
1351
+ data : label
1352
+ } ) ;
1353
+ } ) ;
1354
+ removeButtonUsingGo . addEventListener ( "click" , ( ) => {
1355
+ void Emit ( { name : "remove:badge" , data : null } ) ;
1356
+ } ) ;
1341
1357
On ( "time" , ( time ) => {
1342
1358
timeElement . innerText = time . data ;
1343
1359
} ) ;
0 commit comments