webstaff: transit list: don't reset form
authorGalen Charlton <gmc@esilibrary.com>
Wed, 4 May 2016 19:01:50 +0000 (15:01 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 18 Aug 2016 19:34:20 +0000 (15:34 -0400)
$location.path(foo) is a setter, and should not
be used to calculate a URL for opening a new window
unless you also want to refresh the source page.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/web/js/ui/default/staff/circ/transits/list.js

index b3634c4..9dd066d 100644 (file)
@@ -18,8 +18,8 @@ angular.module('egTransitListApp',
 })
 
 .controller('TransitListCtrl',
-       ['$scope','$q','$routeParams','$window','$location','egCore','egTransits','egGridDataProvider',
-function($scope , $q , $routeParams , $window , $location , egCore , egTransits , egGridDataProvider) {
+       ['$scope','$q','$routeParams','$window','egCore','egTransits','egGridDataProvider',
+function($scope , $q , $routeParams , $window , egCore , egTransits , egGridDataProvider) {
 
     var transits = [];
     var provider = egGridDataProvider.instance({});
@@ -68,11 +68,10 @@ function($scope , $q , $routeParams , $window , $location , egCore , egTransits
         if (!angular.isArray(transits)) transits = [transits];
         angular.forEach(transits, function(transit) {
             $window.open(
-                $location.path(
-                    '/cat/item/' + transit.target_copy().id()
-                ).absUrl(),
+                egCore.env.basePath + '/cat/item/' +
+                transit.target_copy().id(),
                 '_blank'
-            ).focus();
+            ).focus()
         });
     }