faster JS from swipe

This commit is contained in:
Matias Alejo Garcia 2015-04-29 12:42:08 -03:00
commit 3c598fb4d0

View file

@ -7,23 +7,20 @@ angular.module('copayApp.services').factory('go', function($window, $rootScope,
if (typeof document === 'undefined') if (typeof document === 'undefined')
return; return;
// hack to hide sidebars and use ng-click (no href=) var elem = document.getElementById('off-canvas-wrap');
var win = angular.element($window); elem.className = 'off-canvas-wrap';
var elem = angular.element(document.querySelector('#off-canvas-wrap'))
elem.removeClass('move-right');
elem.removeClass('move-left');
}; };
var toggleSidebar = function(invert) { var toggleSidebar = function(invert) {
if (typeof document === 'undefined') if (typeof document === 'undefined')
return; return;
var elem = angular.element(document.querySelector('#off-canvas-wrap')); var elem = document.getElementById('off-canvas-wrap');
var leftbarActive = angular.element(document.getElementsByClassName('move-right')).length; var leftbarActive = elem.className.indexOf('move-right') >= 0;
if (invert) { if (invert) {
if (profileService.profile && !$rootScope.hideNavigation) { if (profileService.profile && !$rootScope.hideNavigation) {
elem.addClass('move-right'); elem.className = 'off-canvas-wrap move-right';
} }
} else { } else {
if (leftbarActive) { if (leftbarActive) {