])
.controller('OfflineCtrl',
- ['$q','$scope','$window','$location','$rootScope','egCore','egLovefield','$routeParams','$timeout','$http','ngToast','egConfirmDialog',
- function($q , $scope , $window , $location , $rootScope , egCore , egLovefield , $routeParams , $timeout , $http , ngToast , egConfirmDialog) {
+ ['$q','$scope','$window','$location','$rootScope','egCore','egLovefield','$routeParams','$timeout','$http','ngToast','egConfirmDialog','egUnloadPrompt',
+ function($q , $scope , $window , $location , $rootScope , egCore , egLovefield , $routeParams , $timeout , $http , ngToast , egConfirmDialog , egUnloadPrompt) {
$scope.active_tab = $routeParams.tab || 'checkout';
var today = new Date();
}
return $q.all(promises.concat(prints)).finally(function() {
+ egUnloadPrompt.clear();
if (prints.length > 1) $scope.printed = true;
$scope.all_xact = [];
$scope.xact_page = { checkin:[], checkout:[], renew:[], in_house_use:[] };
);
$scope.all_xact.push(xact)
+ egUnloadPrompt.attach($rootScope);
$scope[xtype] = {};
// it's been called before. This will allow for re-attach after
// the user clicks through the unload warning. egUnloadPrompt
// will ensure we only attach once.
- egUnloadPrompt.attach($scope);
+ egUnloadPrompt.attach($rootScope);
}
// also monitor when form is changed *by the user*, as using
// an ng-change handler doesn't work with eg-date-input
$scope.$watch('reg_form.$pristine', function(newVal, oldVal) {
- if (!newVal) egUnloadPrompt.attach($scope);
+ if (!newVal) egUnloadPrompt.attach($rootScope);
});
// username regex (if present) must be removed any time