Skip to content

Commit 194fdf7

Browse files
Merge pull request tidev#293 from pegli/TIMOB-15402
[TIMOB-15402] Unable to add NavigationWindow to Popover.
2 parents e745c49 + 84f47ec commit 194fdf7

6 files changed

Lines changed: 48 additions & 3 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var _ = require('../../../lib/alloy/underscore')._;
2+
3+
exports.parse = function(node, state) {
4+
_.extend(state, {
5+
proxyPropertyDefinition: {
6+
parents: [
7+
'Ti.UI.iPad.Popover'
8+
]
9+
}
10+
});
11+
return require('./Alloy.Abstract._ProxyProperty').parse(node, state);
12+
};

Alloy/common/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ exports.IMPLICIT_NAMESPACES = {
151151
ButtonName: NS_ALLOY_ABSTRACT,
152152
BarItemTypes: NS_ALLOY_ABSTRACT,
153153
BarItemType: NS_ALLOY_ABSTRACT,
154+
ContentView: NS_ALLOY_ABSTRACT,
154155
CoverFlowImageTypes: NS_ALLOY_ABSTRACT,
155156
CoverFlowImageType: NS_ALLOY_ABSTRACT,
156157
FlexSpace: NS_ALLOY_ABSTRACT,

test/apps/ui/popover/controllers/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
function openPopover() {
22
if (Ti.Platform.osname === 'ipad') {
33
var popover = Alloy.createController('popover').getView();
4-
popover.show({view:$.button});
4+
popover.show({view:$.button1});
5+
} else {
6+
alert('Popover only supported on iPad');
7+
}
8+
}
9+
10+
function openPopoverWithContentView() {
11+
if (Ti.Platform.osname === 'ipad') {
12+
var popover = Alloy.createController('popover_with_content_view').getView();
13+
popover.show({view:$.button2});
514
} else {
615
alert('Popover only supported on iPad');
716
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
function open_window(e) {
4+
var win = Ti.UI.createWindow({
5+
backgroundColor: "blue"
6+
});
7+
$.navWindow.openWindow(win, { animated: true });
8+
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Alloy>
2-
<Window>
3-
<Button id="button" onClick="openPopover">popover</Button>
2+
<Window layout="vertical">
3+
<Button id="button1" onClick="openPopover" top="20">popover</Button>
4+
<Button id="button2" onClick="openPopoverWithContentView">popover with content view</Button>
45
</Window>
56
</Alloy>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Alloy>
2+
<Popover title="popover" height="300" width="250">
3+
<ContentView>
4+
<NavigationWindow id="navWindow">
5+
<Window>
6+
<RightNavButton>
7+
<Button title="Open Window" onClick="open_window"/>
8+
</RightNavButton>
9+
<Label>This is a window in a popover</Label>
10+
</Window>
11+
</NavigationWindow>
12+
</ContentView>
13+
</Popover>
14+
</Alloy>

0 commit comments

Comments
 (0)