From 221f038831b4930b8e4b8d5340b5abcc150749ff Mon Sep 17 00:00:00 2001 From: Eric Holscher Date: Sat, 7 Jan 2012 18:45:26 -0800 Subject: [PATCH] Vastly simplify that code, from an example, higher in the file. :) --- media/javascript/rtd.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/media/javascript/rtd.js b/media/javascript/rtd.js index bfba188b441..709a5878aaa 100644 --- a/media/javascript/rtd.js +++ b/media/javascript/rtd.js @@ -24,11 +24,6 @@ warning = '

Note< function getVersions() { $('#version_menu').empty() - current_url = window.location.pathname.toString(); - current = current_url.split('/en/')[1] - postfix = current.split('/') - postfix.shift() - current_url = postfix.join('/') $.ajax({ type: 'GET', //This has to be hard coded for CNAMEs, subdomains. @@ -37,7 +32,8 @@ warning = '

Note< success: function(data, textStatus, request) { for (key in data['objects']) { obj = data['objects'][key] - $("#version_menu").append('

  • ' + obj['slug'] + '
  • ') + current_url = window.location.pathname.replace(doc_version, obj.slug) + $("#version_menu").append('
  • ' + obj.slug + '
  • ') } }, dataType: 'jsonp'