Problem Description
Steps to reproduce
1.Run following code and check console
Expected result:
'Focus' event fired after 'Open' event
Actual result:
'Focus' event fired before 'Open' event.
Test case
app.js
-------------------
var win = Ti.UI.createWindow({
height:100,
width:100,
url:'win.js',
layout:'vertical'
});
var nav = Ti.UI.iOS.createNavigationWindow({
window:win
});
var mainWin = Ti.UI.createWindow();
var openEvent = 0;
var focusEvent = 0;
win.addEventListener('open',function(){
openEvent += 1;
});
win.addEventListener('focus',function(){
focusEvent += 1;
Ti.API.info("openEvent"+openEvent);
Ti.API.info("focusEvent"+focusEvent);
});
mainWin.addEventListener('open', function(){
nav.open();
});
mainWin.open();
win.js
-------------------
var curWin = Ti.UI.currentWindow;
var l1 = Ti.UI.createLabel({
top:20,
text:'WAITING FOR OPEN EVENT'
});
curWin.add(l1);
No comments