From 27b7d19e2024e21876996b5361f8df9bc99931e8 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 8 Oct 2015 11:07:32 -0400
Subject: [PATCH] queue: Fix placement of nav-based edit links

---
 include/class.queue.php |  7 ++-----
 scp/js/scp.js           | 37 ++++++++++++++++++-------------------
 2 files changed, 20 insertions(+), 24 deletions(-)

diff --git a/include/class.queue.php b/include/class.queue.php
index 64d2e8d99..69a936315 100644
--- a/include/class.queue.php
+++ b/include/class.queue.php
@@ -151,11 +151,8 @@ class CustomQueue extends SavedSearch {
         if (!$this->id)
             return;
 
-        $path = '';
-        if ($this->parent) {
-            $path = rtrim($this->parent->getPath(), '/');
-        }
-        return $path . "/{$this->id}/";
+        $path = $this->parent ? $this->parent->getPath() : '';
+        return $path . "/{$this->id}";
     }
 
     function getFullName() {
diff --git a/scp/js/scp.js b/scp/js/scp.js
index 0bb8a3dc1..3aae1c35d 100644
--- a/scp/js/scp.js
+++ b/scp/js/scp.js
@@ -491,6 +491,24 @@ var scp_prep = function() {
       }
     }
   });
+
+  /* Custom Queues Dropdown */
+  $(function() {
+    // whenever we hover over a menu item that has a submenu
+    $('.editQ').on('mouseover', function() {
+      var $menuItem = $(this),
+          $submenuWrapper = $('.manageQ', $menuItem);
+
+      // grab the menu item's position relative to its positioned parent
+      var menuItemPos = $menuItem.position();
+
+      // place the submenu in the correct position relevant to the menu item
+      $submenuWrapper.css({
+        top: menuItemPos.top - 41,
+        left: menuItemPos.left + Math.round($menuItem.outerWidth() * 0)
+      });
+    });
+  });
 };
 
 $(document).ready(scp_prep);
@@ -1292,22 +1310,3 @@ window.relativeAdjust = setInterval(function() {
         });
     };
 })(jQuery);
-
-/*Custom Queues Dropdown*/
-
-$(function() {
-  // whenever we hover over a menu item that has a submenu
-  $('.editQ').on('mouseover', function() {
-    var $menuItem = $(this),
-        $submenuWrapper = $('.manageQ', $menuItem);
-
-    // grab the menu item's position relative to its positioned parent
-    var menuItemPos = $menuItem.position();
-
-    // place the submenu in the correct position relevant to the menu item
-    $submenuWrapper.css({
-      top: menuItemPos.top - 41,
-      left: menuItemPos.left + Math.round($menuItem.outerWidth() * 0)
-    });
-  });
-});
-- 
GitLab