cf7bfe79ca
When selected custom menu is removed, go to settings menu Allow iframe in custom menu to use Scripting API Return menu object when it is registered, can call remove function on it
15 lines
445 B
JavaScript
15 lines
445 B
JavaScript
let menuIframeApi = undefined;
|
|
|
|
WA.ui.registerMenuCommand('TO WA', () => {
|
|
WA.nav.openTab("https://workadventu.re/");
|
|
})
|
|
|
|
WA.ui.registerMenuCommand('TO WA BY IFRAME', {iframe: 'customIframeMenu.html'});
|
|
|
|
WA.room.onEnterZone('iframeMenu', () => {
|
|
menuIframeApi = WA.ui.registerMenuCommand('IFRAME USE API', {iframe: 'customIframeMenuApi.html', allowApi: true});
|
|
})
|
|
|
|
WA.room.onLeaveZone('iframeMenu', () => {
|
|
menuIframeApi.remove();
|
|
}) |