From 4a8107694eee69afd057788c00758c4e8d89f944 Mon Sep 17 00:00:00 2001 From: Ian Hunter Date: Thu, 28 Aug 2014 13:39:45 -0600 Subject: [PATCH] Fixes namespaces on constructor protytpes For example, the following documentation would not allow for navigational differentiation between q and q#b when viewing the overview for each. I.e., if the user is viewing q#b, the menu might be open for q, or vise versa. ```javascript /** * @constructor */ var q = function(){}; /** * @memberof q */ q.prototype.a; /** * @memberof q * @namespace */ q.prototype.b = {}; /** * blah blah */ q.prototype.b.c = {}; ``` --- static/scripts/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/scripts/main.js b/static/scripts/main.js index 2eeb19bb..13884384 100644 --- a/static/scripts/main.js +++ b/static/scripts/main.js @@ -30,8 +30,8 @@ $(function () { }); // Show an item related a current documentation automatically - var filename = $('.page-title').data('filename').replace(/\.[a-z]+$/, ''); - var $currentItem = $('.navigation .item[data-name*="' + filename + '"]:eq(0)'); + var filename = $('.page-title').data('filename'); + var $currentItem = $('.navigation .item .title a[href*="' + filename + '"]:eq(0)').parents('.item'); if ($currentItem.length) { $currentItem @@ -66,4 +66,4 @@ $(function () { document.getElementsByTagName('BODY')[0].appendChild(s); }); } -}); \ No newline at end of file +});