Wallet/js/services/go.js

26 lines
640 B
JavaScript
Raw Normal View History

2014-12-07 12:44:50 -03:00
'use strict';
angular.module('copayApp.services').factory('go', function($window, $location) {
var root = {};
var hideSidebars = function() {
2014-12-07 14:12:58 -03:00
if (typeof document === 'undefined')
return;
2014-12-07 12:44:50 -03:00
// hack to hide sidebars and use ng-click (no href=)
var win = angular.element($window);
2014-12-07 14:12:58 -03:00
var elem = angular.element(document.querySelector('#off-canvas-wrap'))
2014-12-07 12:44:50 -03:00
elem.removeClass('move-right');
elem.removeClass('move-left');
};
root.go = function(path) {
var parts = path.split('#');
$location.path(parts[0]);
if (parts[1])
$location.hash(parts[1]);
hideSidebars();
};
return root;
});