Merge pull request #1 from cmgustavo/bug/share-app-back-button

Fix back button from share app
This commit is contained in:
Jason Dreyzehner 2016-11-17 10:40:57 -05:00 committed by GitHub
commit 43a5643eb3
5 changed files with 25 additions and 18 deletions

View file

@ -46,20 +46,18 @@ angular.module('copayApp.controllers').controller('completeController', function
});
};
$scope.$on("$ionicView.afterEnter", function() {
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
$scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false;
$scope.rated = (data.stateParams && data.stateParams.rated) ? true : false;
$scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false;
if (!$scope.fromSettings) {
$ionicConfig.views.swipeBackEnabled(false);
} else {
$ionicNavBarDelegate.showBackButton(true);
$ionicConfig.views.swipeBackEnabled(true);
}
});
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
$scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false;
$scope.rated = (data.stateParams && data.stateParams.rated) ? true : false;
$scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false;
storageService.getFeedbackInfo(function(error, info) {
var feedbackInfo = lodash.isString(info) ? JSON.parse(info) : null;

View file

@ -54,9 +54,8 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
$scope.feedback = {};
if ($scope.score) {
$ionicNavBarDelegate.showBackButton(false);
$ionicConfig.views.swipeBackEnabled(false);
} else $ionicNavBarDelegate.showBackButton(true);
}
switch ($scope.score) {
case 1:
@ -90,4 +89,12 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
$scope.showForm = true;
});
$scope.goBack = function() {
$ionicHistory.nextViewOptions({
disableAnimate: false,
historyRoot: true
});
$ionicHistory.goBack();
};
});

View file

@ -7,7 +7,8 @@
// Please include a description of the problem solved by the workaround.
// class to dynamically hide the ion-nav-bar for v1 Amazon flow
ion-nav-bar.hide { display: block !important; }
// Fix hide-nav-bar (true|false)
//ion-nav-bar.hide { display: block !important; }
// the ion tabs element never needs it's own background (backgrounds are
// rendered by the tabs), and the default background would cover the scanner

View file

@ -1,11 +1,11 @@
<ion-view id="complete" hide-tabs>
<ion-nav-bar class="bar-royal" ng-if="fromSettings">
<ion-view id="complete" hide-nav-bar="!fromSettings" hide-tabs>
<ion-nav-bar class="bar-royal">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-title>{{'Share BitPay' | translate}}</ion-nav-title>
</ion-nav-bar>
<ion-content scroll="false">
<a class="close-button" ng-show="!fromSettings" ng-click="close()"><i class="icon ion-ios-close-empty close-home-tip"></i></a>
<ion-content scroll="false" has-header="fromSettings">
<a class="close-button ng-hide" ng-show="!fromSettings" ng-click="close()"><i class="icon ion-ios-close-empty close-home-tip"></i></a>
<div class="complete-layout">
<div class="complete-layout__expand" ng-class="{'fade-in': !animate || socialsharing}">
<div ng-show="fromSettings">

View file

@ -1,12 +1,13 @@
<ion-view id="send-feedback" hide-tabs>
<ion-nav-bar class="bar-royal">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-title>{{'Send Feedback' | translate}}</ion-nav-title>
<ion-nav-buttons side="primary">
<button ng-show="score" class="button no-border" ng-click="sendFeedback(null, true, true)" translate>
<button ng-show="score" class="button no-border ng-hide" ng-click="sendFeedback(null, true, true)" translate>
Cancel
</button>
<button ng-show="!score || fromSettings" class="button back-button button-clear ng-hide" ng-click="goBack()">
<i class="icon ion-ios-arrow-thin-left"></i>
</button>
</ion-nav-buttons>
<ion-nav-buttons side="secondary">
<button ng-disabled="!feedback.value" class="button no-border" type="submit" ng-click="sendFeedback(feedback.value, false)" translate>