When on the CBOX Theme Options page, if you click on a toolbar button multiple times (Start, Options, User Docs, Dev Docs), duplicate tabs are created in the main horizontal navigation of the page.
To fix this, I had to alter the jquery.juicy.browsertabs JS in a few places:
loadTab() method requires looking up the correct tab index so it would find the existing tab
add() method requires checking to see if the tab already exists
It appears that the _getIndex() method returns the incorrect tab index, so I created a new method, getTabIndex(), to do this. Could this be more elegant? Yes, but I'm not too familiar with the JS.
I believe jquery.juicy was created for CBOX Theme, since I couldn't find anything online about it. I could be wrong though. If we don't want to patch up juicy.browsertabs, we could also copy the changes over to dashboard/assets/js/cpanel.js since that file extends juicy.browsertabs, but that would require duplicating the methods I mention above.
I also removed a line where the JS was trying to load the same AJAX hook again after clicking on a toolbar button. See commit 8577149.
Reported internally.
When on the CBOX Theme Options page, if you click on a toolbar button multiple times (Start, Options, User Docs, Dev Docs), duplicate tabs are created in the main horizontal navigation of the page.
To fix this, I had to alter the
jquery.juicy.browsertabs
JS in a few places:It appears that the
_getIndex()
method returns the incorrect tab index, so I created a new method,getTabIndex()
, to do this. Could this be more elegant? Yes, but I'm not too familiar with the JS.I believe
jquery.juicy
was created for CBOX Theme, since I couldn't find anything online about it. I could be wrong though. If we don't want to patch upjuicy.browsertabs
, we could also copy the changes over todashboard/assets/js/cpanel.js
since that file extendsjuicy.browsertabs
, but that would require duplicating the methods I mention above.I also removed a line where the JS was trying to load the same AJAX hook again after clicking on a toolbar button. See commit 8577149.
Tested in Chrome, Firefox and Edge.