{"action":"created","issue":{"url":"https://api.github.com/repos/adgsm/multi-level-push-menu/issues/183","repository_url":"https://api.github.com/repos/adgsm/multi-level-push-menu","labels_url":"https://api.github.com/repos/adgsm/multi-level-push-menu/issues/183/labels{/name}","comments_url":"https://api.github.com/repos/adgsm/multi-level-push-menu/issues/183/comments","events_url":"https://api.github.com/repos/adgsm/multi-level-push-menu/issues/183/events","html_url":"https://github.com/adgsm/multi-level-push-menu/issues/183","id":280935333,"number":183,"title":"How to get menu level on 'onExpandMenuStart' and 'onCollapseMenuStart'?","user":{"login":"mehmetalidumlu","id":15678340,"avatar_url":"https://avatars1.githubusercontent.com/u/15678340?v=4","gravatar_id":"","url":"https://api.github.com/users/mehmetalidumlu","html_url":"https://github.com/mehmetalidumlu","followers_url":"https://api.github.com/users/mehmetalidumlu/followers","following_url":"https://api.github.com/users/mehmetalidumlu/following{/other_user}","gists_url":"https://api.github.com/users/mehmetalidumlu/gists{/gist_id}","starred_url":"https://api.github.com/users/mehmetalidumlu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehmetalidumlu/subscriptions","organizations_url":"https://api.github.com/users/mehmetalidumlu/orgs","repos_url":"https://api.github.com/users/mehmetalidumlu/repos","events_url":"https://api.github.com/users/mehmetalidumlu/events{/privacy}","received_events_url":"https://api.github.com/users/mehmetalidumlu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-12-11T08:42:55Z","updated_at":"2018-05-10T01:18:04Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nI cant catch root menu is open or close. I want hide or show a html element when root menu is opening or closing. 'onExpandMenuStart' and 'onCollapseMenuStart' event is run all menu process and returns only 'options' parameters in function. \r\n\r\n**How can get menu level which it is processing?**\r\n\r\nThanks..."},"comment":{"url":"https://api.github.com/repos/adgsm/multi-level-push-menu/issues/comments/387921468","html_url":"https://github.com/adgsm/multi-level-push-menu/issues/183#issuecomment-387921468","issue_url":"https://api.github.com/repos/adgsm/multi-level-push-menu/issues/183","id":387921468,"user":{"login":"wal88","id":28649222,"avatar_url":"https://avatars0.githubusercontent.com/u/28649222?v=4","gravatar_id":"","url":"https://api.github.com/users/wal88","html_url":"https://github.com/wal88","followers_url":"https://api.github.com/users/wal88/followers","following_url":"https://api.github.com/users/wal88/following{/other_user}","gists_url":"https://api.github.com/users/wal88/gists{/gist_id}","starred_url":"https://api.github.com/users/wal88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wal88/subscriptions","organizations_url":"https://api.github.com/users/wal88/orgs","repos_url":"https://api.github.com/users/wal88/repos","events_url":"https://api.github.com/users/wal88/events{/privacy}","received_events_url":"https://api.github.com/users/wal88/received_events","type":"User","site_admin":false},"created_at":"2018-05-10T01:18:04Z","updated_at":"2018-05-10T01:18:04Z","author_association":"NONE","body":"I had this issue as well, onCollapseMenuStart/End applies to main menu and clicking on \"Back\" and onExpandMenuStart/End applies to main menu as well as opening submenus. The way I did it was it track if a back is clicked using the option \"onBackItemClick\", then inside onCollapseMenuStart check if it was a back click first (note, onBackItemClick option must come first). For onExpandMenuStart, it's easy just track if menu was collapsed\r\n\r\nvar collapsed = false;\r\nvar isBackClick = false;\r\n```\r\n$('#menu').multilevelpushmenu({\r\n        overlapWidth: 40,\r\n        menuWidth: '25%',\r\n        // unfortunately, \"Back\" counts as a \"CollapseMenu\"\r\n        // track it here\r\n        onBackItemClick: function () {\r\n            isBackClick = true;\r\n        },\r\n        // only resize if main menu is collapsing and Not for a \"Back\" collapse\r\n        onCollapseMenuStart: function () {\r\n            if (!isBackClick) {\r\n               // Functions you would like when main menu is collapsed\r\n               collapsed = true;\r\n            }\r\n            isBackClick = false;\r\n        },\r\n        onExpandMenuStart: function () {\r\n            if (collapsed) {\r\n                 // Functions you would like when main menu is opened again\r\n                 collapsed = false;\r\n            }\r\n        }\r\n    });```"}}
{"actor":{"display_login":"wal88"}}