cordova-plugin-themeablebrowser
cordova-plugin-themeablebrowser copied to clipboard
Menu button events problem (iOS only)
Hey,
when using the menu option with different items, the event corresponding to a specific option isn't triggered correctly.
If you click on a menu option, the menu would close but there is no event emitting. You need to click on the menu icon again (not the menu option, just the menu itself) to receive the earlier missing event. So it seems the event emitting under iOS is somewhat buggy.
Cheers, Antony
please paste in the code for event handling
Sure, check the following snippet:
themeableBrowserWindowRef = cordova.ThemeableBrowser.open(url, '_blank', browser_options
).addEventListener('backPressed', function (e) {
themeableBrowserWindowRef.close();
themeableBrowserWindowRef = undefined;
}).addEventListener('logoPressed', function (e) {
themeableBrowserWindowRef.close();
themeableBrowserWindowRef = undefined;
}).addEventListener('sharePressed', function (e) {
console.log("share pressed");
window.plugins.socialsharing.share('Message only');
}).addEventListener('openPressed', function (e) {
console.log("open pressed");
cordova.ThemeableBrowser.open("http://google.de", '_system');
}).addEventListener(cordova.ThemeableBrowser.EVT_ERR, function (e) {
console.error(e.message);
}).addEventListener(cordova.ThemeableBrowser.EVT_WRN, function (e) {
console.debug(e.message);
}).addEventListener('exit', function (e) {
$rootScope.$broadcast("inAppBrowser:exit");
});
browser_options contains among other things:
menu: {
wwwImage: 'images/menu-dots-light.png',
wwwImageDensity: 4,
title: 'Menu',
cancel: 'Cancel',
align: 'right',
items: [
{
event: 'sharePressed',
label: 'Share'
},
{
event: 'openPressed',
label: 'Open'
}
]
},
Thanks in advance.
Regards, Antony
@sencenan Are you still with me here on this topic? :)
@sencenan Any news here?