From 391d123f31bc821be5485b801c7d5a0139be9970 Mon Sep 17 00:00:00 2001 From: ARvind Tiwari Date: Sat, 29 Jul 2017 18:37:56 +0530 Subject: [PATCH] nav js modified --- datacenterlight/static/datacenterlight/js/main.js | 8 ++------ .../templates/datacenterlight/includes/_navbar.html | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index 44b92a0c..5594fe11 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -91,16 +91,12 @@ var href = $(this).attr('data-url'); $('.navbar-collapse').removeClass('in'); $('.navbar-collapse').addClass('collapsing'); - var url = window.location.pathname; - var urlSplit = url.split('/'); - if (urlSplit.length === 3 && urlSplit[2] === 'datacenterlight') { + if ($(href).length) { $('html, body').animate({ scrollTop: $(href).offset().top }, 1000); } else { - var allUrl = window.location.href; - var redirect = allUrl.split('whydatacenterlight') - window.location.href = '/en-us/datacenterlight' + href; + window.location.href = '/datacenterlight' + href; } }); } diff --git a/datacenterlight/templates/datacenterlight/includes/_navbar.html b/datacenterlight/templates/datacenterlight/includes/_navbar.html index 84358b4d..b32fe10d 100644 --- a/datacenterlight/templates/datacenterlight/includes/_navbar.html +++ b/datacenterlight/templates/datacenterlight/includes/_navbar.html @@ -33,7 +33,7 @@
  • - {% trans "Why Data Center Light?" %} + {% trans "Why Data Center Light?" %}
  • {% trans "Contact" %}