Merge pull request #2583 from matiaspando/bug/hideMenu

Hiding menu on send.js
This commit is contained in:
Matias Alejo Garcia 2015-04-21 13:13:14 -03:00
commit 58d58e416f
4 changed files with 20 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<div
ng-show="!index.noFocusedWallet"
ng-show="!index.noFocusedWallet && !hideMenuBar"
class="bottom-bar row collapse"
ng-controller="menuController as menu">
<div class="medium-3 small-3 columns text-center bottombar-item" ng-repeat="item in menu.menu">

View File

@ -6,6 +6,8 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.onGoingProcess = {};
self.limitHistory = 5;
self.hideMenuBar = false;
function strip(number) {
return (parseFloat(number.toPrecision(12)));
};

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('sendController',
function($rootScope, $scope, $window, $timeout, $modal, $filter, $log, notification, isMobile, txStatus, isCordova, bitcore, profileService, configService, rateService, isChromeApp) {
function($rootScope, $scope, $window, $timeout, $modal, $filter, $log, notification, isMobile, txStatus, isCordova, bitcore, profileService, configService, rateService, isChromeApp, lodash) {
var fc = profileService.focusedClient;
var self = this;
@ -48,6 +48,7 @@ angular.module('copayApp.controllers').controller('sendController',
});
$scope.$on('$destroy', function() {
$rootScope.hideMenuBar = false;
openScannerCordova();
paymentUri();
});
@ -55,7 +56,18 @@ angular.module('copayApp.controllers').controller('sendController',
this.setInputs();
};
var hideMenuBar = lodash.debounce(function(hide) {
if (hide) {
$rootScope.hideMenuBar = true;
} else {
$rootScope.hideMenuBar = false;
}
$rootScope.$digest();
}, 100);
this.formFocus = function(what) {
hideMenuBar(what);
if (!this.isWindowsPhoneApp) return
if (!what) {
@ -277,7 +289,7 @@ angular.module('copayApp.controllers').controller('sendController',
}
};
this.resetForm = function(form) {
this.resetError();

View File

@ -2,6 +2,7 @@
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, notification, txStatus, isCordova, profileService, lodash) {
$rootScope.hideMenuBar = false;
$scope.openCopayersModal = function(copayers, copayerId) {
var fc = profileService.focusedClient;
@ -160,11 +161,11 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$scope.loading = false;
// Hacky: request tries to parse an empty response
if (err && !(err.message && err.message.match(/Unexpected/)) ) {
if (err && !(err.message && err.message.match(/Unexpected/))) {
$scope.error = err.message || 'Transaction could not be deleted. Please try again.';
$scope.$digest();
return;
}
}
$modalInstance.close();
});
}, 100);