fix hidden sidebars in cordova

This commit is contained in:
Matias Alejo Garcia 2014-12-07 14:12:58 -03:00
commit 4be558d143
5 changed files with 17 additions and 7 deletions

View file

@ -1,11 +1,11 @@
'use strict';
angular.module('copayApp.services')
.factory('applicationService', function($rootScope, $location, $timeout, go) {
.factory('applicationService', function($rootScope, $location, $timeout, go, isCordova) {
var root = {};
var isChromeApp = window.chrome && chrome.runtime && chrome.runtime.id;
root.restart = function() {
if (1 || window.cordova !== undefined) {
if (isCordova) {
$rootScope.iden = $rootScope.wallet = undefined;
go.go('/');
$timeout(function(){

View file

@ -4,15 +4,21 @@ angular.module('copayApp.services').factory('go', function($window, $location) {
var root = {};
var hideSidebars = function() {
if (typeof document === 'undefined')
return;
// hack to hide sidebars and use ng-click (no href=)
var win = angular.element($window);
var elem = win.find('#off-canvas-wrap');
console.log('[go.js.8:win:]',win); //TODO
var elem = angular.element(document.querySelector('#off-canvas-wrap'))
console.log('[go.js.10:elem:]',elem); //TODO
elem.removeClass('move-right');
elem.removeClass('move-left');
};
root.go = function(path) {
var parts = path.split('#');
console.log('[go.js.15:parts:]',parts); //TODO
$location.path(parts[0]);
if (parts[1])
$location.hash(parts[1]);