Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5093] Debugger: add an inspector for event handlers

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2017-07-20T19:26:40.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsapi, debugger, tbs-1.9.0
ReporterKetan Majmudar
AssigneeIngo Muschenetz
Created2011-08-24T10:22:45.000+0000
Updated2017-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();
  });
});

Comments

  1. Lee Morris 2017-07-20

    Duplicate of TIMOB-5092.

JSON Source