From 102978f87914a0efbbd02eb066093c3837a7d0dc Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 22 Mar 2018 02:29:32 +0530 Subject: [PATCH 1/2] contact section heading --- datacenterlight/static/datacenterlight/css/landing-page.css | 6 ++++++ datacenterlight/templates/datacenterlight/cms/contact.html | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/datacenterlight/static/datacenterlight/css/landing-page.css b/datacenterlight/static/datacenterlight/css/landing-page.css index 6361ea21..2779b8c7 100755 --- a/datacenterlight/static/datacenterlight/css/landing-page.css +++ b/datacenterlight/static/datacenterlight/css/landing-page.css @@ -107,6 +107,12 @@ textarea { text-decoration: none; } +.topnav .nav .open>a, +.topnav .nav .open>a:focus, +.topnav .nav .open>a:hover { + background: transparent; +} + .navbar .dcl-link { display: block; padding: 15px; diff --git a/datacenterlight/templates/datacenterlight/cms/contact.html b/datacenterlight/templates/datacenterlight/cms/contact.html index 63455dd0..2cf77efb 100644 --- a/datacenterlight/templates/datacenterlight/cms/contact.html +++ b/datacenterlight/templates/datacenterlight/cms/contact.html @@ -3,9 +3,9 @@
- {% if instance.contact_text %} + {% if instance.heading%}
-

{{ instance.contact_text }}

+

{{ instance.heading}}

{% endif %}
From f1a77d65c421a670eb2cce25a0cbc37a626dc209 Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 22 Mar 2018 02:43:53 +0530 Subject: [PATCH 2/2] link target with absolute path on same page scrolls --- .../static/datacenterlight/js/main.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/datacenterlight/static/datacenterlight/js/main.js b/datacenterlight/static/datacenterlight/js/main.js index 5e919045..dc5a9108 100644 --- a/datacenterlight/static/datacenterlight/js/main.js +++ b/datacenterlight/static/datacenterlight/js/main.js @@ -104,21 +104,33 @@ }); $('.url').click(function(event) { event.preventDefault(); - var href = $(this).attr('href'); + var $this = $(this); + var href = $this.attr('href'); $('.navbar-collapse').removeClass('in'); $('.navbar-collapse').addClass('collapsing'); if (href[0] === "#") { - if ($(href).length) { - $('html, body').animate({ - scrollTop: $(href).offset().top - 50 - }, 1000); - } + scrollToElement(href); } else if (href) { - window.location = href; + var path = $(this).prop('href').split('#'); + var currentPath = window.location.origin + window.location.pathname; + if (!path[1]) { + window.location = href; + } else if (currentPath == path[0]) { + scrollToElement('#' + path[1]); + } } }); } + function scrollToElement(el) { + var $el = $(el); + if ($el.length) { + $('html, body').animate({ + scrollTop: $el.offset().top - 50 + }, 1000); + } + } + function verifiedUrl() { if (window.location.href.indexOf('#success') > -1) { form_success();