added escape key handler (#461)
Added escape key handler for drawer2type
This commit is contained in:
parent
6dbdb85aaf
commit
b05ad2392b
7 changed files with 90 additions and 8 deletions
|
@ -38,8 +38,8 @@ PageType {
|
|||
tabBar.enabled = !visible
|
||||
}
|
||||
|
||||
function onEnableTabBar(enabled) {
|
||||
tabBar.enabled = enabled
|
||||
function onDisableControls(disabled) {
|
||||
tabBar.enabled = !disabled
|
||||
}
|
||||
|
||||
function onClosePage() {
|
||||
|
@ -70,6 +70,21 @@ PageType {
|
|||
tabBarStackView.pop()
|
||||
}
|
||||
}
|
||||
|
||||
function onEscapePressed() {
|
||||
if (!tabBar.enabled || busyIndicator.visible) {
|
||||
return
|
||||
}
|
||||
|
||||
var pageName = tabBarStackView.currentItem.objectName
|
||||
if ((pageName === PageController.getPagePath(PageEnum.PageShare)) ||
|
||||
(pageName === PageController.getPagePath(PageEnum.PageSettings))) {
|
||||
PageController.goToPageHome()
|
||||
tabBar.previousIndex = 0
|
||||
} else {
|
||||
PageController.closePage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue