ddavydenko commented on a change in pull request #13921: Version switching user experience improvements URL: https://github.com/apache/incubator-mxnet/pull/13921#discussion_r248823701
########## File path: docs/_static/js/docversion.js ########## @@ -18,16 +18,23 @@ */ /* Set the version of the website */ -function setVersion(){ - let doc = window.location.pathname.match(/^\/(api\/.*)$/) || window.location.pathname.match(/^\/versions\/[^*]+\/(api\/.*)$/); +function setVersion(anchor){ + if (arguments.length==0) { + anchor = window.location.hash + }; + console.log('anchor: ', anchor, arguments.length, window.location.hash, window.location.search); + //let doc = window.location.pathname.match(/^\/(api\/.*)$/) || window.location.pathname.match(/^\/versions\/[^*]+\/(api\/.*)$/); + let doc = window.location.pathname.match(/^\/versions\/[^\/]+\/([^*]+.*)$/); if (doc) { if (document.getElementById('dropdown-menu-position-anchor-version')) { versionNav = $('#dropdown-menu-position-anchor-version a.main-nav-link'); $(versionNav).each( function( index, el ) { currLink = $( el ).attr('href'); - version = currLink.match(/\/versions\/([0-9.master]+)\//); + version = currLink.match(/\/versions\/([^\/]+)\//); + console.log(version); Review comment: I suggest to remove this debugging statement from production code. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services