[TIMOB-5093] Debugger: add an inspector for event handlers
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Low |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2017-07-20T19:26:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | api, debugger, tbs-1.9.0 |
Reporter | Ketan Majmudar |
Assignee | Ingo Muschenetz |
Created | 2011-08-24T10:22:45.000+0000 |
Updated | 2017-07-20T19:26:40.000+0000 |
Description
When debugging, it would be good to see all assigned eventHandlers connected to objects - this would allow an easy way to check that an event has been attached or removed. I think web inspectors/firebug has this ability. I came across a use case where my events weren't triggering, this facility would have helped in debugging the reason.
The following is just a simple testcase, with two windows and two eventListeners, that may be used to prove that the improvement works.
var win1 = Ti.UI.createWindow({
backgroundColor:'blue',
exitOnClose:true,
title:'win1: Main Window'
});
var label1 = Ti.UI.createLabel({
text:'Click this to open sub window',
height:66,
width:200
});
win1.add(label1);
win1.open();
label1.addEventListener('click', function(){
Ti.API.info('*** label1 click event creating and opening win2 ***');
var win2 = Ti.UI.createWindow({
backgroundColor:'green',
fullscreen:'false', // heavyweight
title:'win2: Sub Window'
});
win2.open();
win2.addEventListener('click', function(){
Ti.API.info('*** win2 click event closing win2 ***');
win2.close();
});
});
Duplicate of TIMOB-5092.