{ "id": "108875", "key": "AC-2714", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-02-07T01:24:39.000+0000", "created": "2013-01-30T18:20:25.000+0000", "labels": [], "versions": [], "issuelinks": [ { "id": "25604", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "107740", "key": "ALOY-455", "fields": { "summary": "Remove Backbone eventing from Titanium proxies", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:41:49.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14544", "name": "Alloy", "description": "Please enter tickets related to the Alloy here." } ], "description": "As per API of backbonejs, on/off/trigger return 'this' so that calls may be chained.\r\n\r\nhttp://backbonejs.org/docs/backbone.html#section-19\r\n\r\nThis is what's appeared in Alloy.\r\n\r\nexports.A = function(t, type, parent) {\r\n _.extend(t, Backbone.Events);\r\n (function() {\r\n var al = t.addEventListener, rl = t.removeEventListener, oo = t.on, of = t.off, tg = t.trigger, cbs = {}, ctx = _.extend({}, Backbone.Events);\r\n if (!al || !rl) return;\r\n t.trigger = function() {\r\n ctx.trigger.apply(ctx, Array.prototype.slice.apply(arguments));\r\n };\r\n t.on = function(e, cb, context) {\r\n var wcb = function(evt) {\r\n try {\r\n _.bind(tg, ctx, e, evt)();\r\n } catch (E) {\r\n Ti.API.error(\"Error triggering '\" + e + \"' event: \" + E);\r\n }\r\n };\r\n if (!cbs[e]) {\r\n cbs[e] = {};\r\n al(e, wcb);\r\n }\r\n cbs[e][cb] = wcb;\r\n _.bind(oo, ctx, e, cb, context)();\r\n };\r\n t.off = function(e, cb, context) {\r\n var f = cbs[e] ? cbs[e][cb] : null;\r\n if (f) {\r\n _.bind(of, ctx, e, cb, context)();\r\n delete cbs[e][cb];\r\n if (cbs[e].length === 0) {\r\n delete cbs[e];\r\n rl(e, f);\r\n }\r\n f = null;\r\n }\r\n };\r\n })();\r\n return t;\r\n};\r\n", "attachment": [], "flagged": false, "summary": "Alloy on/off/trigger for View is not returning the View itself", "creator": { "name": "mingrobo", "key": "mingrobo", "displayName": "Ming Liu", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mingrobo", "key": "mingrobo", "displayName": "Ming Liu", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "0.3.2", "comment": { "comments": [ { "id": "237582", "author": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As of Alloy 1.0.0, Backbone eventing will be removed from Titanium proxies for performance reasons. Details can be found in ALOY-455.", "updateAuthor": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-07T01:24:39.000+0000", "updated": "2013-02-07T01:24:39.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }