navbar link hash fixed, footer links fixed
This commit is contained in:
parent
3ed2399337
commit
5550867870
6 changed files with 80 additions and 59 deletions
|
@ -86,6 +86,20 @@
|
|||
}
|
||||
|
||||
function _initNavUrl() {
|
||||
$('.url-init').each(function(idx, el) {
|
||||
var $this = $(el);
|
||||
var currentPath = window.location.pathname;
|
||||
var thisPaths = $this.attr('href').split('#')
|
||||
if ($this.hasClass('dropdown-toggle') && window.matchMedia("(max-width: 767px)").matches) {
|
||||
$this.removeClass('url-init');
|
||||
$this.attr('href', '');
|
||||
} else if ($('#'+thisPaths[1]).length) {
|
||||
$this.removeClass('url-init').addClass('url');
|
||||
$this.attr('href', '#' + thisPaths[1]);
|
||||
} else {
|
||||
$this.removeClass('url-init');
|
||||
}
|
||||
});
|
||||
$('.url').click(function(event) {
|
||||
event.preventDefault();
|
||||
var href = $(this).attr('href');
|
||||
|
@ -95,8 +109,6 @@
|
|||
$('html, body').animate({
|
||||
scrollTop: $(href).offset().top
|
||||
}, 1000);
|
||||
} else {
|
||||
window.location.href = '/datacenterlight' + href;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -2,52 +2,37 @@
|
|||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<ul class="list-inline">
|
||||
{% if request.resolver_match.url_name == "index" %}
|
||||
<li>
|
||||
<a class="url" href="javascript:void(0)" data-url="#how" >{% trans "Highlights" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="url" href="javascript:void(0)" data-url="#your" >{% trans "Scale out" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="url" href="javascript:void(0)" data-url="#our">{% trans "Reliable and light" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="url" href="javascript:void(0)" data-url="#price" >{% trans "Order VM" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="url" href="javascript:void(0)" data-url="#contact" >{% trans "Contact" %}</a>
|
||||
</li>
|
||||
{% else %}
|
||||
{% if request.resolver_match.url_name != "index" %}
|
||||
<li>
|
||||
<a href="{% url 'datacenterlight:index' %}">{% trans "Home" %}</a>
|
||||
</li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="{% url 'datacenterlight:index' %}#how">{% trans "Highlights" %}</a></li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<a class="url-init" href="{% url 'datacenterlight:index' %}#how">{% trans "Highlights" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'datacenterlight:index' %}#your">{% trans "Scale out" %}</a></li>
|
||||
<li>⋅</li>
|
||||
<a class="url-init" href="{% url 'datacenterlight:index' %}#your">{% trans "Scale out" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{% url 'datacenterlight:index' %}#our">{% trans "Reliable and light" %}</a></li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
<a class="url-init" href="{% url 'datacenterlight:index' %}#our">{% trans "Reliable and light" %}</a>
|
||||
</li>
|
||||
{% if request.resolver_match.url_name != "index" %}
|
||||
<li>
|
||||
<a href="{% url 'datacenterlight:index' %}#price">{% trans "Pricing" %}</a>
|
||||
<a class="url-init" href="{% url 'datacenterlight:index' %}#price">{% trans "Pricing" %}</a>
|
||||
</li>
|
||||
<li class="footer-menu-divider">⋅</li>
|
||||
{% else %}
|
||||
<li>
|
||||
<a href="{% url 'datacenterlight:index' %}#contact">{% trans "Contact" %}</a>
|
||||
<a class="url-init" href="{% url 'datacenterlight:index' %}#price">{% trans "Order VM" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a class="url-init" href="{% url 'datacenterlight:index' %}#contact">{% trans "Contact" %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p class="copyright text-muted small">Copyright © ungleich GmbH {% now "Y" %}. {% trans "All Rights Reserved" %}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -16,12 +16,11 @@
|
|||
<!-- Start Navbar collapse-->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown highlights-dropdown">
|
||||
<a class="dropdown-toggle url visible-desktop" href="#how" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %} <span class="caret"></span></a>
|
||||
<a class="dropdown-toggle visible-mobile" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %} <span class="caret"></span></a>
|
||||
<a class="dropdown-toggle url-init" href="{% url 'datacenterlight:index' %}#how" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Highlights" %} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu ">
|
||||
<li><a class="url" href="#your">{% trans "Scale out" %}</a></li>
|
||||
<li><a class="url" href="#our">{% trans "Reliable and light" %}</a></li>
|
||||
<li> <a class="url" href="#price">{% trans "Order VM" %}</a></li>
|
||||
<li><a class="url-init" href="{% url 'datacenterlight:index' %}#your">{% trans "Scale out" %}</a></li>
|
||||
<li><a class="url-init" href="{% url 'datacenterlight:index' %}#our">{% trans "Reliable and light" %}</a></li>
|
||||
<li> <a class="url-init" href="{% url 'datacenterlight:index' %}#price">{% trans "Order VM" %}</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
@ -434,8 +434,8 @@ class PaymentOrderView(FormView):
|
|||
|
||||
@cache_control(no_cache=True, must_revalidate=True, no_store=True)
|
||||
def get(self, request, *args, **kwargs):
|
||||
# if 'specs' not in request.session or 'user' not in request.session:
|
||||
# return HttpResponseRedirect(reverse('datacenterlight:index'))
|
||||
if 'specs' not in request.session or 'user' not in request.session:
|
||||
return HttpResponseRedirect(reverse('datacenterlight:index'))
|
||||
return self.render_to_response(self.get_context_data())
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
|
|
|
@ -107,7 +107,7 @@ h6 {
|
|||
.navbar-right .highlights-dropdown .dropdown-menu > li > a{
|
||||
font-size: 13px;
|
||||
font-weight: 300;
|
||||
font-family: 'Lato-Light', sans-serif;
|
||||
font-family: 'Lato', sans-serif;
|
||||
padding: 1px 10px !important;
|
||||
background: transparent;
|
||||
color: #333;
|
||||
|
|
|
@ -1,5 +1,32 @@
|
|||
// also declared in datacenterlight/js/main.js
|
||||
function _initNavUrl() {
|
||||
// $('.url').click(function(event) {
|
||||
// event.preventDefault();
|
||||
// var href = $(this).attr('href');
|
||||
// $('.navbar-collapse').removeClass('in');
|
||||
// $('.navbar-collapse').addClass('collapsing');
|
||||
// if ($(href).length) {
|
||||
// $('html, body').animate({
|
||||
// scrollTop: $(href).offset().top
|
||||
// }, 1000);
|
||||
// } else {
|
||||
// window.location.href = '/datacenterlight' + href;
|
||||
// }
|
||||
// });
|
||||
$('.url-init').each(function(idx, el) {
|
||||
var $this = $(el);
|
||||
var currentPath = window.location.pathname;
|
||||
var thisPaths = $this.attr('href').split('#')
|
||||
if ($this.hasClass('dropdown-toggle') && window.matchMedia("(max-width: 767px)").matches) {
|
||||
$this.removeClass('url-init');
|
||||
$this.attr('href', '');
|
||||
} else if ($('#'+thisPaths[1]).length) {
|
||||
$this.removeClass('url-init').addClass('url');
|
||||
$this.attr('href', '#' + thisPaths[1]);
|
||||
} else {
|
||||
$this.removeClass('url-init');
|
||||
}
|
||||
});
|
||||
$('.url').click(function(event) {
|
||||
event.preventDefault();
|
||||
var href = $(this).attr('href');
|
||||
|
@ -9,8 +36,6 @@ function _initNavUrl() {
|
|||
$('html, body').animate({
|
||||
scrollTop: $(href).offset().top
|
||||
}, 1000);
|
||||
} else {
|
||||
window.location.href = '/datacenterlight' + href;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue