// Connected footer links and go-top
This commit is contained in:
@@ -24,92 +24,109 @@
|
|||||||
|
|
||||||
$( document ).ready(function() {
|
$( document ).ready(function() {
|
||||||
|
|
||||||
//nav side bar
|
//nav side bar
|
||||||
function navSidebar(){
|
function navSidebar(){
|
||||||
$('body.page-topbar').removeClass('page-topbar').addClass('page-sidebar');
|
$('body.page-topbar').removeClass('page-topbar').addClass('page-sidebar');
|
||||||
$('#nav-topbar').attr('id','nav-sidebar');
|
$('#nav-topbar').attr('id','nav-sidebar');
|
||||||
$('#nav-sidebar').off();
|
$('#nav-sidebar').off();
|
||||||
$('.expanded').removeClass('expanded');
|
$('.expanded').removeClass('expanded');
|
||||||
$('.maintab').not('.active').closest('.submenu').hide();
|
$('.maintab').not('.active').closest('.submenu').hide();
|
||||||
$('#nav-sidebar li.maintab.has_submenu').append('<span class="submenu_expand"></span>');
|
$('#nav-sidebar li.maintab.has_submenu').append('<span class="submenu_expand"></span>');
|
||||||
$('#nav-sidebar .submenu_expand').on('click',function(){
|
$('#nav-sidebar .submenu_expand').on('click',function(){
|
||||||
var $navId = $(this).parent();
|
var $navId = $(this).parent();
|
||||||
$('.submenu-collapse').remove();
|
$('.submenu-collapse').remove();
|
||||||
if($('.expanded').length ){
|
if($('.expanded').length ){
|
||||||
$('.expanded > ul').slideUp(
|
$('.expanded > ul').slideUp(
|
||||||
'fast',
|
'fast',
|
||||||
function(){
|
function(){
|
||||||
var $target = $('.expanded');
|
var $target = $('.expanded');
|
||||||
$target.removeClass('expanded');
|
$target.removeClass('expanded');
|
||||||
$($navId).not($target).not('.active').addClass('expanded');
|
$($navId).not($target).not('.active').addClass('expanded');
|
||||||
$($navId).not($target).not('.active').children('ul:first').hide().slideDown();
|
$($navId).not($target).not('.active').children('ul:first').hide().slideDown();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$($navId).not('.active').addClass('expanded');
|
$($navId).not('.active').addClass('expanded');
|
||||||
$($navId).not('.active').children('ul:first').hide().slideDown();
|
$($navId).not('.active').children('ul:first').hide().slideDown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//nav top bar
|
//nav top bar
|
||||||
function navTopbar(){
|
function navTopbar(){
|
||||||
$('body').removeClass('page-sidebar').removeClass('page-sidebar-closed').addClass('page-topbar');
|
$('body').removeClass('page-sidebar').removeClass('page-sidebar-closed').addClass('page-topbar');
|
||||||
$('#nav-sidebar').attr('id','nav-topbar');
|
$('#nav-sidebar').attr('id','nav-topbar');
|
||||||
$('#nav-topbar').off();
|
$('#nav-topbar').off();
|
||||||
$('span.submenu_expand').remove();
|
$('span.submenu_expand').remove();
|
||||||
$('.expanded').removeClass('expanded');
|
$('.expanded').removeClass('expanded');
|
||||||
|
|
||||||
$('#nav-topbar').on('mouseenter', 'li.maintab.has_submenu',
|
$('#nav-topbar').on('mouseenter', 'li.maintab.has_submenu',
|
||||||
function(){
|
function(){
|
||||||
$(this).addClass('expanded');
|
$(this).addClass('expanded');
|
||||||
});
|
});
|
||||||
$('#nav-topbar').on('mouseleave', 'li.maintab.has_submenu',
|
$('#nav-topbar').on('mouseleave', 'li.maintab.has_submenu',
|
||||||
function(){
|
function(){
|
||||||
$(this).removeClass('expanded');
|
$(this).removeClass('expanded');
|
||||||
});
|
});
|
||||||
|
|
||||||
//todo hide element over menu width on load
|
//todo hide element over menu width on load
|
||||||
$('#nav-topbar').find('li.maintab').each(
|
$('#nav-topbar').find('li.maintab').each(
|
||||||
function(){
|
function(){
|
||||||
if ($(this).position().top > 0) {
|
if ($(this).position().top > 0) {
|
||||||
$(this).addClass('hide');
|
$(this).addClass('hide');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//todo hide element over menu width on resize
|
//todo hide element over menu width on resize
|
||||||
$(window).on('resize', function() {
|
$(window).on('resize', function() {
|
||||||
$('#nav-topbar ul.menu').find('li.maintab').each(function(){
|
$('#nav-topbar ul.menu').find('li.maintab').each(function(){
|
||||||
if ($(this).position().top > 0) {
|
if ($(this).position().top > 0) {
|
||||||
$(this).addClass('hide');
|
$(this).addClass('hide');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//nav switch
|
//nav switch
|
||||||
function navSwitch(){
|
function navSwitch(){
|
||||||
if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed')) {
|
if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed'))
|
||||||
navTopbar();
|
navTopbar();
|
||||||
} else {
|
else
|
||||||
navSidebar();
|
navSidebar();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//init menu
|
//init menu
|
||||||
if ($('body').hasClass('page-sidebar')){
|
if ($('body').hasClass('page-sidebar'))
|
||||||
navSidebar();
|
navSidebar();
|
||||||
} else if($('body').hasClass('page-topbar')) {
|
else if ($('body').hasClass('page-topbar'))
|
||||||
navTopbar();
|
navTopbar();
|
||||||
}
|
|
||||||
|
|
||||||
//tooltip
|
//tooltip
|
||||||
$('.label-tooltip').tooltip();
|
$('.label-tooltip').tooltip();
|
||||||
|
|
||||||
//sidebar menu collapse
|
//sidebar menu collapse
|
||||||
$('.menu-collapse').click(function(){
|
$('.menu-collapse').click(function(){
|
||||||
$('body').toggleClass('page-sidebar-closed');
|
$('body').toggleClass('page-sidebar-closed');
|
||||||
$('.expanded').removeClass('expanded');
|
$('.expanded').removeClass('expanded');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function animateGoTop() {
|
||||||
|
if ($(window).scrollTop())
|
||||||
|
{
|
||||||
|
$('#go-top:hidden').stop(true, true).fadeIn();
|
||||||
|
$('#go-top:hidden').removeClass('hide');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$('#go-top').stop(true, true).fadeOut();
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#go-top").click(function() {
|
||||||
|
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$(window).scroll(function() {
|
||||||
|
animateGoTop();
|
||||||
|
});
|
||||||
|
animateGoTop();
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -27,51 +27,35 @@
|
|||||||
</div>
|
</div>
|
||||||
{if $display_footer}
|
{if $display_footer}
|
||||||
{hook h="displayBackOfficeFooter"}
|
{hook h="displayBackOfficeFooter"}
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
<div class="col-sm-5 hidden-xs">
|
<div class="col-sm-5 hidden-xs">
|
||||||
<a href="http://www.prestashop.com/" target="_blank">PrestaShop™ {$ps_version}</a> - <span>{l s='Load time: '} {number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
|
<a href="http://www.prestashop.com/" target="_blank">PrestaShop™ {$ps_version}</a> - <span>{l s='Load time: '} {number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
|
||||||
</div>
|
|
||||||
<div class="col-sm-2 hidden-xs social-networks">
|
|
||||||
<a class="link-social link-twitter" href="#" title="Twitter">
|
|
||||||
<i class="icon-twitter"></i>
|
|
||||||
</a>
|
|
||||||
<a class="link-social link-facebook" href="#" title="Facebook">
|
|
||||||
<i class="icon-facebook"></i>
|
|
||||||
</a>
|
|
||||||
<a class="link-social link-github" href="#" title="Github">
|
|
||||||
<i class="icon-github"></i>
|
|
||||||
</a>
|
|
||||||
<a class="link-social link-google" href="#" title="Google">
|
|
||||||
<i class="icon-google-plus"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-5">
|
|
||||||
<a href="http://www.prestashop.com/en/contact_us?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Contact'}</a>
|
|
||||||
| <a href="http://forge.prestashop.com/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|
|
||||||
| <a href="http://www.prestashop.com/forums/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Forum'}</a>
|
|
||||||
| <a href="http://addons.prestashop.com/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Addons'}</a>
|
|
||||||
{if $iso_is_fr}
|
|
||||||
<p>Questions / Renseignements / Formations :
|
|
||||||
<strong>+33 (0)1.40.18.30.04</strong>
|
|
||||||
<p>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
<div id="go-top"><i class="icon-arrow-up"></i></div>
|
|
||||||
<script>
|
|
||||||
$("#go-top").click(function() {
|
|
||||||
$("html, body").animate({ scrollTop: 0 }, "slow");
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$(window).scroll(function() {
|
|
||||||
if ($(this).scrollTop()) {
|
|
||||||
$('#go-top:hidden').stop(true, true).fadeIn();
|
|
||||||
} else {
|
|
||||||
$('#go-top').stop(true, true).fadeOut();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-sm-2 hidden-xs social-networks">
|
||||||
|
<a class="link-social link-twitter" href="https://twitter.com/PrestaShop" title="Twitter">
|
||||||
|
<i class="icon-twitter"></i>
|
||||||
|
</a>
|
||||||
|
<a class="link-social link-facebook" href="https://www.facebook.com/prestashop" title="Facebook">
|
||||||
|
<i class="icon-facebook"></i>
|
||||||
|
</a>
|
||||||
|
<a class="link-social link-github" href="https://github.com/PrestaShop/PrestaShop/" title="Github">
|
||||||
|
<i class="icon-github"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-5">
|
||||||
|
<a href="http://www.prestashop.com/en/contact_us?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Contact'}</a>
|
||||||
|
| <a href="http://forge.prestashop.com/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|
||||||
|
| <a href="http://www.prestashop.com/forums/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Forum'}</a>
|
||||||
|
| <a href="http://addons.prestashop.com/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Addons'}</a>
|
||||||
|
{if $iso_is_fr}
|
||||||
|
<p>Questions / Renseignements / Formations :
|
||||||
|
<strong>+33 (0)1.40.18.30.04</strong>
|
||||||
|
<p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<div id="go-top" class="hide"><i class="icon-arrow-up"></i></div>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user