webstaff: Just build the path directly, we know our base
authorMike Rylander <mrylander@gmail.com>
Thu, 23 Apr 2015 21:09:34 +0000 (17:09 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Wed, 19 Aug 2015 17:39:17 +0000 (13:39 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/web/js/ui/default/staff/services/navbar.js

index 6a32056..67c117d 100644 (file)
@@ -30,14 +30,10 @@ angular.module('egCoreMod')
             function($scope , $window , $location , $timeout , hotkeys , egCore) {
 
                 function navTo(path) {                                           
-                    // $location.path() does not want a leading ".",
-                    // which <a>'s will have.  
-                    // Note: avoid using $location.path() to derive the new
-                    // URL, since it creates an intermediate path change.
-                    path = path.replace(/^\./,'');
+                    // Strip the leading "./" if any.
+                    path = path.replace(/^\.\//,'');
                     var reg = new RegExp($location.path());
-                    $window.location.href = 
-                        $window.location.href.replace(reg, path);
+                    $window.location.href = egCore.env.basePath + path;
                 }       
 
                 // adds a keyboard shortcut