Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5662] MobileWeb: Property 'orientation' of the event 'orientationchange' of the Ti.Gesture module returns 0

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-06-27T05:18:15.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMobileWeb
Labelsn/a
ReporterMisha Vasko
AssigneeMaxim Negadaylov
Created2011-06-27T03:40:22.000+0000
Updated2017-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);

Comments

  1. Lee Morris 2017-03-09

    Closing ticket as fixed.

JSON Source