From ecaf2c36df2aa097a61f9660decdbc15410d6f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 28 Jun 2016 16:30:53 -0300 Subject: [PATCH] fix scaling issue in wp8 and show menu bar when backbutton is pressed on send view --- cordova/build.sh | 3 +++ public/views/walletHome.html | 8 ++++---- src/css/mobile.css | 15 +++++++++++++++ src/js/controllers/walletHome.js | 29 +++-------------------------- src/js/routes.js | 11 +++++++++++ 5 files changed, 36 insertions(+), 30 deletions(-) diff --git a/cordova/build.sh b/cordova/build.sh index f5c9f2a9c..6a99d667b 100755 --- a/cordova/build.sh +++ b/cordova/build.sh @@ -161,6 +161,9 @@ if [ ! -d $PROJECT ]; then cordova plugin add cordova-plugin-screen-orientation checkOK + cordova plugin add ionic-plugin-keyboard + checkOK + fi if $DBGJS diff --git a/public/views/walletHome.html b/public/views/walletHome.html index 8a84bc3f0..f9b5df2a7 100644 --- a/public/views/walletHome.html +++ b/public/views/walletHome.html @@ -35,7 +35,7 @@ --> - +
-
+
-
+
-
+
diff --git a/src/css/mobile.css b/src/css/mobile.css index 094c6360a..2b489f519 100644 --- a/src/css/mobile.css +++ b/src/css/mobile.css @@ -104,6 +104,21 @@ _:-ms-fullscreen, :root .main { } } +@viewport { + width:320px; +} + +@-ms-viewport { + width:320px; + zoom-user:fixed; + max-zoom:1; + min-zoom:1; +} + +body, html { + -ms-overflow-style: none !important; +} + /* removes 300ms in IE */ -ms-touch-action: manipulation; /* IE10 / touch-action: manipulation; /* IE11+ */ diff --git a/src/js/controllers/walletHome.js b/src/js/controllers/walletHome.js index 9d2af9127..25415b1f5 100644 --- a/src/js/controllers/walletHome.js +++ b/src/js/controllers/walletHome.js @@ -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; diff --git a/src/js/routes.js b/src/js/routes.js index 55f1581ee..a768c6313 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -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);