{ "id": "82121", "key": "TIMOB-6152", "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": [], "resolution": { "id": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2020-01-09T19:29:43.000+0000", "created": "2011-10-30T08:16:39.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api" ], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-01-09T19:29:43.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "It would be nice if there was a way to toggle the Ti.UI.iPad.Popover.\r\n\r\nThe usual usecase is that you have a button that opens the popover. If the button is clicked while the popover is visible, nothing happens, but the expected action is that the visible popover is dismissed.\r\n\r\nh4. Testcase\r\nThe testcase shows that if you click the button while the popover is open, nothing happens. What I would like to do is to just switch out the \".show\" method with \".toggle\" and then it would work as intended.\r\n{code}\r\nTi.UI.backgroundColor = '#fff';\r\n\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle: 'Open popover',\r\n\twidth: 150,\r\n\theight: 40\r\n})\r\n\r\nvar popover = Ti.UI.iPad.createPopover({\r\n\theight: 300,\r\n\twidth: 300,\r\n\tbackgroundColor: '#fff'\r\n});\r\n\r\nbutton.addEventListener('click', function() {\r\n\tpopover.show({\r\n\t\tview: button\r\n\t});\r\n});\r\n\r\nwin.leftNavButton = button;\r\n\r\nwin.open({\r\n\tmodal: true\r\n});\r\n{code}\r\n\r\nThis could be easily solved by having a method on the popover object called \".toggle()\", that will show the popover if it's not visible, otherwise hide it.\r\n\r\nThere is a [simple way of doing this|http://stackoverflow.com/questions/2642405/dismissing-ipad-uipopovercontroller-when-barbuttonitem-is-pushed-while-its-open] on StackOverflow.", "attachment": [], "flagged": false, "summary": "iPad: Toggle popover", "creator": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "subtasks": [], "reporter": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "environment": null, "comment": { "comments": [ { "id": "172268", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "A nicely-constructed ticket, Sindre - thank you for the obvious thought you put into it.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2011-11-10T17:42:27.000+0000", "updated": "2011-11-10T17:42:27.000+0000" }, { "id": "202028", "author": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "body": "This feature would be very useful, but still haven't seen any love. If someone could take a look at this ticket, that would be awesome.", "updateAuthor": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "created": "2012-07-08T07:21:31.000+0000", "updated": "2012-07-08T07:21:31.000+0000" }, { "id": "240337", "author": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "body": "bump", "updateAuthor": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "created": "2013-03-01T09:40:40.000+0000", "updated": "2013-03-01T09:40:40.000+0000" }, { "id": "268594", "author": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "body": "bump! This has been open for a really long time with no solution. This is a good ticket, with a testcase and link to a really simple fix. I find it annoying that you would just ignore this for so long.", "updateAuthor": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "created": "2013-08-28T16:00:33.000+0000", "updated": "2013-08-28T16:00:33.000+0000" }, { "id": "303810", "author": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "body": "bump", "updateAuthor": { "name": "mofle", "key": "mofle", "displayName": "Sindre Sorhus", "active": true, "timeZone": "Europe/Oslo" }, "created": "2014-05-07T11:41:35.000+0000", "updated": "2014-05-07T11:41:35.000+0000" }, { "id": "453571", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. Updating, or creating code may not reproduce the issue reported, or be a valid test case.\r\n\r\nIf community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T19:29:43.000+0000", "updated": "2020-01-09T19:29:43.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }