mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-19 02:00:45 +07:00
added escape key handler (#461)
Added escape key handler for drawer2type
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user