{ "id": "137796", "key": "TIMOB-17828", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-10-08T13:19:20.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:37.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "Using strings for event names is prone to typos which cause silent failures. Declaring constants, much like we have for style enumerations, would resolve this problem.\r\n\r\ne.g.\r\n\r\n{code}\r\n$.myButton.addEventListener('cilck', function(e){\r\n // nothing happens but its not obvious why\r\n});\r\n{code}\r\n\r\nCould be replaced with:\r\n\r\n{code}\r\n$.myButton.addEventListener(Titanium.UI.Button.CLICK, function(e){\r\n // ...\r\n});\r\n{code}", "attachment": [], "flagged": false, "summary": "Declare constants for event name strings", "creator": { "name": "cbowley", "key": "cbowley", "displayName": "Chris Bowley", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "cbowley", "key": "cbowley", "displayName": "Chris Bowley", "active": true, "timeZone": "Europe/London" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }