ionic side menu

This commit is contained in:
Gabriel Bazán 2016-05-18 15:15:14 -03:00 committed by Javier
commit d468c28cd0
7 changed files with 105 additions and 161 deletions

View file

@ -1155,18 +1155,14 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
};
self.openMenu = function() {
self.toggleLeftMenu = function() {
profileService.isDisclaimerAccepted(function(val) {
if (val) go.swipe(true);
if (val) go.toggleLeftMenu();
else
$log.debug('Disclaimer not accepted, cannot open menu');
});
};
self.closeMenu = function() {
go.swipe();
};
self.retryScan = function() {
var self = this;
self.startScan(self.walletId);

View file

@ -20,11 +20,6 @@ angular.module('copayApp.controllers').controller('sidebarController',
self.setWallets();
});
self.closeMenu = function() {
go.swipe();
};
self.signout = function() {
profileService.signout();
};

View file

@ -1,36 +1,10 @@
'use strict';
angular.module('copayApp.services').factory('go', function($window, $rootScope, $location, $state, $timeout, $log, profileService, platformInfo, nodeWebkit) {
angular.module('copayApp.services').factory('go', function($window, $ionicSideMenuDelegate, $rootScope, $location, $state, $timeout, $log, profileService, platformInfo, nodeWebkit) {
var root = {};
var hideSidebars = function() {
if (typeof document === 'undefined')
return;
var elem = document.getElementById('off-canvas-wrap');
elem.className = 'off-canvas-wrap';
};
var toggleSidebar = function(invert) {
if (typeof document === 'undefined')
return;
var elem = document.getElementById('off-canvas-wrap');
var leftbarActive = elem.className.indexOf('move-right') >= 0;
if (invert) {
if (profileService.profile && !$rootScope.hideNavigation) {
elem.className = 'off-canvas-wrap move-right';
}
} else {
if (leftbarActive) {
hideSidebars();
}
}
};
root.openExternalLink = function(url, target) {
if ( platformInfo.isNW) {
if (platformInfo.isNW) {
nodeWebkit.openExternalLink(url);
} else {
target = target || '_blank';
@ -49,11 +23,10 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
}, function() {
if (cb) return cb('animation in progress');
});
hideSidebars();
};
root.swipe = function(invert) {
toggleSidebar(invert);
root.toggleLeftMenu = function() {
$ionicSideMenuDelegate.toggleLeft()
};
root.walletHome = function() {