[TIMOB-5662] MobileWeb: Property 'orientation' of the event 'orientationchange' of the Ti.Gesture module returns 0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-27T05:18:15.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | n/a |
Reporter | Misha Vasko |
Assignee | Maxim Negadaylov |
Created | 2011-06-27T03:40:22.000+0000 |
Updated | 2017-03-09T20:51:21.000+0000 |
Description
Property 'orientation' of the event 'orientationchange' of the Ti.Gesture module returns 0. It should return different constants depend on the orientation of the device.
var win = Ti.UI.currentWindow;
win.backgroundColor = '#EEE';
var label = Ti.UI.createLabel({
text: '1. Rotate your device 90 degrees.\n 2. Shake your device',
fontSize: 30,
top: 40,
left: 30
});
var closeButton = Ti.UI.createButton({
title:'Close Window',
height:50,
width:140,
fontSize: 16,
top:130,
left:90
});
closeButton.addEventListener('click', function(){
Ti.Gesture.removeEventListener('orientationchange',orientation);
Ti.Gesture.removeEventListener('shake',shaking);
Titanium.UI.currentWindow.close();
});
win.add(closeButton);
win.add(label);
function orientation(e){
alert('Your orientation is '+ e.orientation);
};
function shaking(){
alert('You are shaking your device!');
};
Ti.Gesture.addEventListener('orientationchange',orientation);
Ti.Gesture.addEventListener('shake',shaking);
Closing ticket as fixed.