mirror of https://github.com/BTCPrivate/copay.git
adding controllers to route file, moving swipe back enable to enter event
This commit is contained in:
parent
91b62bb884
commit
14baa77404
|
@ -12,9 +12,11 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
$ionicConfig.views.swipeBackEnabled(true);
|
$ionicConfig.views.swipeBackEnabled(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.enter", function(event, data) {
|
||||||
|
|
||||||
$ionicConfig.views.swipeBackEnabled(false);
|
$ionicConfig.views.swipeBackEnabled(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
|
|
||||||
toAmount = data.stateParams.toAmount;
|
toAmount = data.stateParams.toAmount;
|
||||||
cachedSendMax = {};
|
cachedSendMax = {};
|
||||||
|
|
|
@ -50,6 +50,11 @@ angular.module('copayApp.controllers').controller('completeController', function
|
||||||
$ionicConfig.views.swipeBackEnabled(true);
|
$ionicConfig.views.swipeBackEnabled(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function() {
|
||||||
|
if (!$scope.fromSettings)
|
||||||
|
$ionicConfig.views.swipeBackEnabled(false);
|
||||||
|
});
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
|
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
|
||||||
$scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false;
|
$scope.skipped = (data.stateParams && data.stateParams.skipped) ? true : false;
|
||||||
|
@ -57,11 +62,9 @@ angular.module('copayApp.controllers').controller('completeController', function
|
||||||
$scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false;
|
$scope.fromSettings = (data.stateParams && data.stateParams.fromSettings) ? true : false;
|
||||||
|
|
||||||
if (!$scope.fromSettings) {
|
if (!$scope.fromSettings) {
|
||||||
$ionicConfig.views.swipeBackEnabled(false);
|
|
||||||
$ionicNavBarDelegate.showBackButton(false);
|
$ionicNavBarDelegate.showBackButton(false);
|
||||||
} else {
|
} else {
|
||||||
$ionicNavBarDelegate.showBackButton(true);
|
$ionicNavBarDelegate.showBackButton(true);
|
||||||
$ionicConfig.views.swipeBackEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
storageService.getFeedbackInfo(function(error, info) {
|
storageService.getFeedbackInfo(function(error, info) {
|
||||||
|
|
|
@ -45,15 +45,16 @@ angular.module('copayApp.controllers').controller('sendController', function($sc
|
||||||
$ionicConfig.views.swipeBackEnabled(true);
|
$ionicConfig.views.swipeBackEnabled(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function(event, data) {
|
||||||
|
if ($scope.score)
|
||||||
|
$ionicConfig.views.swipeBackEnabled(false);
|
||||||
|
});
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
$scope.isCordova = platformInfo.isCordova;
|
||||||
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
|
$scope.score = (data.stateParams && data.stateParams.score) ? parseInt(data.stateParams.score) : null;
|
||||||
$scope.feedback = {};
|
$scope.feedback = {};
|
||||||
|
|
||||||
if ($scope.score) {
|
|
||||||
$ionicConfig.views.swipeBackEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($scope.score) {
|
switch ($scope.score) {
|
||||||
case 1:
|
case 1:
|
||||||
$scope.reaction = "Ouch!";
|
$scope.reaction = "Ouch!";
|
||||||
|
|
|
@ -4,12 +4,12 @@ angular.module('copayApp.controllers').controller('backupRequestController', fun
|
||||||
|
|
||||||
$scope.walletId = $stateParams.walletId;
|
$scope.walletId = $stateParams.walletId;
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeLeave", function(event, data) {
|
$scope.$on("$ionicView.enter", function() {
|
||||||
$ionicConfig.views.swipeBackEnabled(true);
|
$ionicConfig.views.swipeBackEnabled(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
$scope.$on("$ionicView.beforeLeave", function() {
|
||||||
$ionicConfig.views.swipeBackEnabled(false);
|
$ionicConfig.views.swipeBackEnabled(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.openPopup = function() {
|
$scope.openPopup = function() {
|
||||||
|
|
|
@ -6,7 +6,7 @@ angular.module('copayApp.controllers').controller('collectEmailController', func
|
||||||
$ionicConfig.views.swipeBackEnabled(true);
|
$ionicConfig.views.swipeBackEnabled(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function() {
|
$scope.$on("$ionicView.enter", function() {
|
||||||
$ionicConfig.views.swipeBackEnabled(false);
|
$ionicConfig.views.swipeBackEnabled(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService, $rootScope) {
|
angular.module('copayApp.controllers').controller('disclaimerController', function($scope, $timeout, $state, $log, $ionicModal, $ionicConfig, profileService, uxLanguage, externalLinkService, storageService, $stateParams, startupService, $rootScope) {
|
||||||
|
|
||||||
$scope.$on("$ionicView.afterEnter", function() {
|
$scope.$on("$ionicView.afterEnter", function() {
|
||||||
startupService.ready();
|
startupService.ready();
|
||||||
|
@ -11,12 +11,15 @@ angular.module('copayApp.controllers').controller('disclaimerController', functi
|
||||||
$scope.terms = {};
|
$scope.terms = {};
|
||||||
$scope.accepted = {};
|
$scope.accepted = {};
|
||||||
$scope.accepted.first = $scope.accepted.second = $scope.accepted.third = false;
|
$scope.accepted.first = $scope.accepted.second = $scope.accepted.third = false;
|
||||||
$scope.backedUp = $stateParams.backedUp;
|
$scope.backedUp = $stateParams.backedUp == 'false' ? false : true;
|
||||||
$scope.resume = $stateParams.resume || false;
|
$scope.resume = $stateParams.resume || false;
|
||||||
if ($scope.backedUp || $scope.resume) $ionicConfig.views.swipeBackEnabled(false);
|
|
||||||
$scope.shrinkView = false;
|
$scope.shrinkView = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$scope.$on("$ionicView.enter", function() {
|
||||||
|
if ($scope.backedUp || $scope.resume) $ionicConfig.views.swipeBackEnabled(false);
|
||||||
|
});
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeLeave", function() {
|
$scope.$on("$ionicView.beforeLeave", function() {
|
||||||
$ionicConfig.views.swipeBackEnabled(true);
|
$ionicConfig.views.swipeBackEnabled(true);
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, $interval) {
|
angular.module('copayApp.controllers').controller('notificationsController', function($scope, $state, $timeout, $stateParams, $ionicConfig, profileService, configService, $interval) {
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function() {
|
$scope.$on("$ionicView.enter", function() {
|
||||||
$ionicConfig.views.swipeBackEnabled(false);
|
$ionicConfig.views.swipeBackEnabled(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $ionicConfig, $log, profileService, startupService, storageService) {
|
angular.module('copayApp.controllers').controller('welcomeController', function($scope, $state, $timeout, $ionicConfig, $log, profileService, startupService, storageService) {
|
||||||
|
|
||||||
$scope.$parent.$on("$ionicView.afterEnter", function() {
|
$scope.$on("$ionicView.afterEnter", function() {
|
||||||
startupService.ready();
|
startupService.ready();
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", function() {
|
$scope.$on("$ionicView.enter", function() {
|
||||||
$ionicConfig.views.swipeBackEnabled(false);
|
$ionicConfig.views.swipeBackEnabled(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -699,7 +699,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/welcome',
|
url: '/welcome',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/onboarding/welcome.html'
|
templateUrl: 'views/onboarding/welcome.html',
|
||||||
|
controller: 'welcomeController'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -707,7 +708,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/tour',
|
url: '/tour',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/onboarding/tour.html'
|
templateUrl: 'views/onboarding/tour.html',
|
||||||
|
controller: 'tourController'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -715,7 +717,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/collectEmail/:walletId',
|
url: '/collectEmail/:walletId',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/onboarding/collectEmail.html'
|
templateUrl: 'views/onboarding/collectEmail.html',
|
||||||
|
controller: 'collectEmailController'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -723,7 +726,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/notifications/:walletId',
|
url: '/notifications/:walletId',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/onboarding/notifications.html'
|
templateUrl: 'views/onboarding/notifications.html',
|
||||||
|
controller: 'notificationsController'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -731,7 +735,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/backupRequest/:walletId',
|
url: '/backupRequest/:walletId',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/onboarding/backupRequest.html'
|
templateUrl: 'views/onboarding/backupRequest.html',
|
||||||
|
controller: 'backupRequestController'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -739,7 +744,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/backupWarning/:from/:walletId',
|
url: '/backupWarning/:from/:walletId',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/backupWarning.html'
|
templateUrl: 'views/backupWarning.html',
|
||||||
|
controller: 'backupWarningController'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -765,7 +771,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
url: '/terms',
|
url: '/terms',
|
||||||
views: {
|
views: {
|
||||||
'onboarding': {
|
'onboarding': {
|
||||||
templateUrl: 'views/onboarding/terms.html'
|
templateUrl: 'views/onboarding/terms.html',
|
||||||
|
controller: 'termsController'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<ion-view id="backup-warning" class="onboarding" ng-controller="backupWarningController" hide-tabs>
|
<ion-view id="backup-warning" class="onboarding" hide-tabs>
|
||||||
<ion-nav-bar>
|
<ion-nav-bar>
|
||||||
<ion-nav-buttons side="primary">
|
<ion-nav-buttons side="primary">
|
||||||
<button class="button button-back button-clear" ng-click="goBack()">
|
<button class="button button-back button-clear" ng-click="goBack()">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<ion-view id="onboarding-backup-request" class="onboarding">
|
<ion-view id="onboarding-backup-request" class="onboarding">
|
||||||
<ion-content ng-controller="backupRequestController" scroll="false">
|
<ion-content scroll="false">
|
||||||
<div id="warning">
|
<div id="warning">
|
||||||
<img class="svg" src="img/onboarding-warning.svg" id="alert-icon">
|
<img class="svg" src="img/onboarding-warning.svg" id="alert-icon">
|
||||||
<div class="onboarding-topic" translate>No backup, no bitcoin.</div>
|
<div class="onboarding-topic" translate>No backup, no bitcoin.</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<ion-view ng-controller="collectEmailController" id="onboarding-collect-email" class="onboarding">
|
<ion-view id="onboarding-collect-email" class="onboarding">
|
||||||
<ion-content scroll="false">
|
<ion-content scroll="false">
|
||||||
<div id="success-container">
|
<div id="success-container">
|
||||||
<img src="img/onboarding-success.svg" id="success-image" />
|
<img src="img/onboarding-success.svg" id="success-image" />
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<ion-pane class="pane-onboarding">
|
<ion-pane class="pane-onboarding">
|
||||||
<ion-view id="onboarding-disclaimer" class="onboarding" ng-class="{'shrink': shrinkView}">
|
<ion-view id="onboarding-disclaimer" class="onboarding" ng-class="{'shrink': shrinkView}">
|
||||||
<ion-nav-bar class="bar-stable" ng-if="backedUp == 'false'">
|
<ion-nav-bar class="bar-stable" ng-if="!backedUp">
|
||||||
<ion-nav-title></ion-nav-title>
|
<ion-nav-title></ion-nav-title>
|
||||||
<ion-nav-buttons side="primary">
|
<ion-nav-buttons side="primary">
|
||||||
<button class="button back-button button-clear" ng-click="goBack()">
|
<button class="button back-button button-clear" ng-click="goBack()">
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
</button>
|
</button>
|
||||||
</ion-nav-buttons>
|
</ion-nav-buttons>
|
||||||
</ion-nav-bar>
|
</ion-nav-bar>
|
||||||
<ion-content scroll="false" ng-class="{'has-header': backedUp == 'false'}">
|
<ion-content scroll="false" ng-class="{'has-header': !backedUp}">
|
||||||
<div id="onboarding-disclaimer-container">
|
<div id="onboarding-disclaimer-container">
|
||||||
<div ng-show="resume" class="onboarding-topic" id="disclaimer-topic" translate>Quick review!</div>
|
<div ng-show="resume" class="onboarding-topic" id="disclaimer-topic" translate>Quick review!</div>
|
||||||
<div ng-show="!resume" class="onboarding-topic" id="disclaimer-topic" translate>Almost done! Let's review.</div>
|
<div ng-show="!resume" class="onboarding-topic" id="disclaimer-topic" translate>Almost done! Let's review.</div>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<div ng-include="'views/includes/terms.html'" direction="y"></div>
|
<div ng-include="'views/includes/terms.html'" direction="y"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="agree-to-terms" ng-if="accepted.first && accepted.second" ng-class="{'header-present': backedUp == 'false'}">
|
<div id="agree-to-terms" ng-if="accepted.first && accepted.second" ng-class="{'header-present': !backedUp}">
|
||||||
<div id="agree-to-terms-content" class="center-block">
|
<div id="agree-to-terms-content" class="center-block">
|
||||||
<ion-checkbox ng-model="terms.accepted"></ion-checkbox>
|
<ion-checkbox ng-model="terms.accepted"></ion-checkbox>
|
||||||
<p translate>I have read, understood, and agree to the <a ng-click="openTerms()" translate>Terms of Use</a>.</p>
|
<p translate>I have read, understood, and agree to the <a ng-click="openTerms()" translate>Terms of Use</a>.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<ion-view class="onboarding" id="onboarding-push-notifications">
|
<ion-view class="onboarding" id="onboarding-push-notifications">
|
||||||
<ion-content ng-controller="notificationsController" scroll="false">
|
<ion-content scroll="false">
|
||||||
<div class="onboarding-topic" id="notifications-topic" translate>Push Notifications</div>
|
<div class="onboarding-topic" id="notifications-topic" translate>Push Notifications</div>
|
||||||
<div class="onboarding-description" translate>Would you like to receive push notifications about payments?</div>
|
<div class="onboarding-description" translate>Would you like to receive push notifications about payments?</div>
|
||||||
<div class="onboarding-illustration-notifications"></div>
|
<div class="onboarding-illustration-notifications"></div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<ion-view ng-controller="tourController" class="onboarding" id="onboarding-tour">
|
<ion-view class="onboarding" id="onboarding-tour">
|
||||||
<ion-nav-bar>
|
<ion-nav-bar>
|
||||||
<ion-nav-title></ion-nav-title>
|
<ion-nav-title></ion-nav-title>
|
||||||
<ion-nav-buttons side="primary">
|
<ion-nav-buttons side="primary">
|
||||||
|
|
Loading…
Reference in New Issue