From 9fcd5828cea062c394e8c7e278b0c690ea4ff87e Mon Sep 17 00:00:00 2001 From: pererinha Date: Tue, 17 Sep 2013 23:46:57 -0300 Subject: [PATCH] partial #1769 --- www/assets/js/controllers.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/www/assets/js/controllers.js b/www/assets/js/controllers.js index e267713d2..557f43764 100644 --- a/www/assets/js/controllers.js +++ b/www/assets/js/controllers.js @@ -627,11 +627,6 @@ NGApp.controller( 'GiftcardCtrl', function ($scope, $location, GiftCardService ) setTimeout( function(){ GiftCardService.open(); }, 300 ); }); -NGApp.controller('reset', function ($scope, $location, AccountModalService) { - $scope.modal = AccountModalService; - $scope.modal.resetOpen(); - $location.path( '/' ); -}); NGApp.controller( 'AccountModalHeaderCtrl', function ( $scope, $http, AccountModalService ) { $scope.modal = AccountModalService; @@ -660,8 +655,12 @@ NGApp.controller( 'AccountSignUpCtrl', function ( $scope, $http, AccountModalSer }); }); -NGApp.controller( 'AccountResetCtrl', function ( $scope, $http, AccountResetService ) { - $scope.reset = AccountResetService; +NGApp.controller( 'AccountResetCtrl', function ( $scope, $http, $location, AccountResetService, AccountModalService ) { + if( $location.path().indexOf( 'reset' ) >= 0 ){ + $scope.reset = AccountResetService; + AccountModalService.resetOpen(); + $location.path( '/' ); + } }); NGApp.controller( 'GiftCardCtrl', function ( $scope, $http, $rootScope, GiftCardService ) {