fix scaling issue in wp8 and show menu bar when backbutton is pressed on send view

This commit is contained in:
Gabriel Bazán 2016-06-28 16:30:53 -03:00
commit ecaf2c36df
5 changed files with 36 additions and 30 deletions

View file

@ -272,19 +272,16 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.hideMenuBar = lodash.debounce(function(hide) {
if (hide) {
$rootScope.shouldHideMenuBar = true;
this.bindTouchDown();
} else {
$rootScope.shouldHideMenuBar = false;
}
$rootScope.$digest();
}, 100);
this.formFocus = function(what) {
if (isCordova && !this.isWindowsPhoneApp) {
if (isCordova && this.isWindowsPhoneApp) {
this.hideMenuBar(what);
}
var self = this;
if (isCordova && !this.isWindowsPhoneApp && what == 'address') {
getClipboard(function(value) {
@ -297,24 +294,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
}
});
}
if (!this.isWindowsPhoneApp) return
if (!what) {
this.hideAddress = false;
this.hideAmount = false;
} else {
if (what == 'amount') {
this.hideAddress = true;
} else if (what == 'msg') {
this.hideAddress = true;
this.hideAmount = true;
}
}
$timeout(function() {
$rootScope.$digest();
}, 1);
};
this.setSendFormInputs = function() {
@ -402,10 +381,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.resetError();
if (isCordova && this.isWindowsPhoneApp) {
this.hideAddress = false;
this.hideAmount = false;
}
if (isCordova && this.isWindowsPhoneApp)
$rootScope.shouldHideMenuBar = true;
var form = $scope.sendForm;
var comment = form.comment.$modelValue;

View file

@ -536,6 +536,17 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$ionicPlatform.ready(function() {
if (platformInfo.isCordova) {
window.addEventListener('native.keyboardhide', function() {
$timeout(function() {
$rootScope.shouldHideMenuBar = false; //show menu bar when keyboard is hidden with back button action on send screen
}, 300);
});
window.addEventListener('native.keyboardshow', function() {
$rootScope.shouldHideMenuBar = true; //hide menu bar when keyboard opens with back button action on send screen
$rootScope.$digest();
});
$ionicPlatform.registerBackButtonAction(function(event) {
event.preventDefault();
}, 100);