{ "id": "88587", "key": "TIMOB-8224", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13207", "name": "Sprint 2012-07", "archived": true, "released": true, "releaseDate": "2012-04-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-03-26T14:52:29.000+0000", "created": "2012-03-23T10:20:32.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "mw-list" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2017-03-03T23:35:27.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": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "h2. Problem\r\n\r\nExecuting code against views in mobileweb from the view's containing window's {{open}} event does not ensure that the view has completely loaded. I would expect for mobileweb that the {{Window.open}} event would be much like jQuery's {{ready}}, meaning that you are free to start manipulating the elements contained within it. This is not the case.\r\n\r\nh2. Test Case\r\n\r\nAll of the properties of {{view}} in this test case will animate from zero. I assume this is because the view's properties are not fully loaded when the {{window.open}} event fires. The comments portion with the {{setTimeout}} call will execute as expected, albeit with a 2 second delay. \r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff',\r\n\tfullscreen: false,\r\n\texitOnClose: true\r\n});\r\n\r\nvar view = Ti.UI.createView({\r\n\tbackgroundColor: '#a00', \r\n\theight: 100,\r\n\twidth: 100,\r\n\ttop: 500,\r\n\tleft: 500\r\n});\r\nvar anim = Ti.UI.createAnimation({\r\n\tduration: 5000,\r\n\ttop: 10,\r\n\tleft: 10\r\n});\r\n\r\nwin.add(view);\r\nwin.addEventListener('open', function(e) {\r\n\t// All of the view's properties will animate from zero, not the \r\n\t// values specified above in its creation\r\n\tview.animate(anim);\r\n\t\r\n\t// This code will work \r\n\t// setTimeout(function() {\r\n\t\t// view.animate(anim);\r\n\t// }, 2000);\r\n});\r\n\r\nwin.open();\r\n{code}\r\n\r\nh2. Proposed Solution\r\n\r\nHave {{Window.open}} fire only when it and all of its child components have also loaded. This way developers can be assured that all necessary manipulations are safe in the {{open}} event.", "attachment": [], "flagged": false, "summary": "Mobileweb: Ti.UI.Window.open event does not mean its views are ready", "creator": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tlukasavage", "key": "tlukasavage", "displayName": "Tony Lukasavage", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OSX 10.7.3\r\nChrome 17\r\nTiSDK 2.0.0v20120322231759\r\nTiStudio 2.0.1.201203221940", "comment": { "comments": [ { "id": "188464", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "After some discussion, the behavior for the window.open event is actually correct, however animation need to deal with this situation. In short, the bug is in animation, not window.open.", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-24T10:30:58.000+0000", "updated": "2012-03-24T10:30:58.000+0000" }, { "id": "188466", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Pull Request: https://github.com/appcelerator/titanium_mobile/pull/1832", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-24T10:53:23.000+0000", "updated": "2012-03-24T10:53:23.000+0000" }, { "id": "409116", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as MobileWeb is no longer supported.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T23:35:27.000+0000", "updated": "2017-03-03T23:35:27.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }