Description
We have modal window and a button. when user clicks on the button alert pops up.
The app is supposed to have only portrait orientation which is set in tiApp.xml file.
When alert pops up, the device supports orientation change.
Testcase
Step to reproduce:
1.Tap on the button in the main window,which opens modal window.
2.Tap on the button in modal window that brings up alert dialog.
3.Try rotating the device and orientation is supported
//app.js
var win = Ti.UI.createWindow({
backgroundColor : '#fff',
orientationModes : [Ti.UI.PORTRAIT] //to be sure
});
var clickMeBtn = Ti.UI.createButton({
title : 'Click to open modal window'
});
var cancelBtn = Ti.UI.createButton({
title : 'cancel'
});
var modalWin = Ti.UI.createWindow({
backgroundColor : '#bbb',
modal : true,
orientationModes : [Ti.UI.PORTRAIT] //to be extra double sure
});
var modalButton = Ti.UI.createButton({
title : 'Click to test Orientation'
});
modalWin.add(modalButton);
modalWin.setLeftNavButton(cancelBtn);
win.add(clickMeBtn);
clickMeBtn.addEventListener('click',function(_event){
modalWin.open();
});
modalButton.addEventListener('click', function(e) {
var dialog = Ti.UI.createAlertDialog({
message: 'Rotate device to see the orientaion change',
ok: 'Okay',
title: 'File Deleted'
}).show();
//alert('Rotate device to see the orientaion change');
});
cancelBtn.addEventListener('click', function(e){
modalWin.close();
});
win.open();
In tiapp.xml
<iphone>
<orientations device="iphone">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
<orientations device="ipad">
<orientation>Ti.UI.PORTRAIT</orientation>
</orientations>
</iphone>
Tested with 3.1.3 githash=df94e5e Tested on Xcode 5 DP 5 ipad 4 ios7 beta 6. Should have been fixed along with windows refactor.
Tested the above code. The app has only portrait orientation. Environment: Appcelerator Studio, build: 3.1.3.201308302458 Titanium SDK, build: 3.1.3.v20130902103448 KS[3_1_X] https://github.com/appcelerator-developer-relations/KitchenSink/tree/3_1_X CLI: 3.1.2 Alloy: 1.2.1 Devices: iPad 4 iOS7(11A4449d)