This repository was archived by the owner on Apr 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
This repository was archived by the owner on Apr 8, 2021. It is now read-only.
Close modal window "activityPopover" not dismissed on iPad #166
Copy link
Copy link
Open
Description
UPDATE: check my comment related to the NavigationWindow systemButton issue.
If the "share activityPopover" is open and you close the embedded browser (modal window) by tapping the close X on the left, the "share activityPopover" remains open. It should close if the embedded browser is closed. There is a way to force close/hide/dismiss the activityPopover on iPad?
// MODAL WINDOW
<NavigationWindow id="navWin" platform="ios">
<Window id="win" title="Loading…">
<LeftNavButton>
<Button systemButton="STOP" onClick="closeWin" title="X" />
</LeftNavButton>
<RightNavButton>
<Button id="shareBtn" systemButton="ACTION" onClick="share" />
</RightNavButton>
<WebView id="webView" onLoad="pageLoaded"></WebView>
</Window>
</NavigationWindow>
// Method responsable for the share
function share(e) {
var Social = OS_IOS ? require('dk.napp.social') : {};
if(OS_IOS && Alloy.isTablet){
Social.activityPopover({
view: $.shareBtn, //or e.source is the same.
subject : pageTitle,
text : pageTitle,
url : $.webView.url,
removeIcons : "print,copy,contact,camera",
}, [{
title : "Copy Link",
type : "copyLink",
image : "/images/socialBar/global-openinsafari.png",
callback : function(e) {
//alert("You chose me!");
}
}, {
title : "Open in Safari",
type : "open.safari",
image : "/images/socialBar/Safari.png",
callback : function(e) {
//alert("You chose me!!");
}
}]);
}
}
/*
* custom event handling
*/
OS_IOS && require('dk.napp.social').addEventListener("complete", function(e){
Ti.API.info("complete: " + JSON.stringify(e));
if(e.activityName == "copyLink"){
Ti.UI.Clipboard.setText($.webView.url);
}
if(e.activityName == "open.safari"){
Ti.Platform.openURL($.webView.url);
}
});
function closeWin() {
if (OS_IOS){
$.navWin.close();
}
}
if (OS_IOS) {
$.navWin.addEventListener("close", function() {
$.destroy();
$.off();
});
}
Metadata
Metadata
Assignees
Labels
No labels