// Connected footer links and go-top
This commit is contained in:
@@ -24,92 +24,109 @@
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
//nav side bar
|
||||
function navSidebar(){
|
||||
$('body.page-topbar').removeClass('page-topbar').addClass('page-sidebar');
|
||||
$('#nav-topbar').attr('id','nav-sidebar');
|
||||
$('#nav-sidebar').off();
|
||||
$('.expanded').removeClass('expanded');
|
||||
$('.maintab').not('.active').closest('.submenu').hide();
|
||||
$('#nav-sidebar li.maintab.has_submenu').append('<span class="submenu_expand"></span>');
|
||||
$('#nav-sidebar .submenu_expand').on('click',function(){
|
||||
var $navId = $(this).parent();
|
||||
$('.submenu-collapse').remove();
|
||||
if($('.expanded').length ){
|
||||
$('.expanded > ul').slideUp(
|
||||
'fast',
|
||||
function(){
|
||||
var $target = $('.expanded');
|
||||
$target.removeClass('expanded');
|
||||
$($navId).not($target).not('.active').addClass('expanded');
|
||||
$($navId).not($target).not('.active').children('ul:first').hide().slideDown();
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
$($navId).not('.active').addClass('expanded');
|
||||
$($navId).not('.active').children('ul:first').hide().slideDown();
|
||||
}
|
||||
});
|
||||
}
|
||||
//nav top bar
|
||||
function navTopbar(){
|
||||
$('body').removeClass('page-sidebar').removeClass('page-sidebar-closed').addClass('page-topbar');
|
||||
$('#nav-sidebar').attr('id','nav-topbar');
|
||||
$('#nav-topbar').off();
|
||||
$('span.submenu_expand').remove();
|
||||
$('.expanded').removeClass('expanded');
|
||||
//nav side bar
|
||||
function navSidebar(){
|
||||
$('body.page-topbar').removeClass('page-topbar').addClass('page-sidebar');
|
||||
$('#nav-topbar').attr('id','nav-sidebar');
|
||||
$('#nav-sidebar').off();
|
||||
$('.expanded').removeClass('expanded');
|
||||
$('.maintab').not('.active').closest('.submenu').hide();
|
||||
$('#nav-sidebar li.maintab.has_submenu').append('<span class="submenu_expand"></span>');
|
||||
$('#nav-sidebar .submenu_expand').on('click',function(){
|
||||
var $navId = $(this).parent();
|
||||
$('.submenu-collapse').remove();
|
||||
if($('.expanded').length ){
|
||||
$('.expanded > ul').slideUp(
|
||||
'fast',
|
||||
function(){
|
||||
var $target = $('.expanded');
|
||||
$target.removeClass('expanded');
|
||||
$($navId).not($target).not('.active').addClass('expanded');
|
||||
$($navId).not($target).not('.active').children('ul:first').hide().slideDown();
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
$($navId).not('.active').addClass('expanded');
|
||||
$($navId).not('.active').children('ul:first').hide().slideDown();
|
||||
}
|
||||
});
|
||||
}
|
||||
//nav top bar
|
||||
function navTopbar(){
|
||||
$('body').removeClass('page-sidebar').removeClass('page-sidebar-closed').addClass('page-topbar');
|
||||
$('#nav-sidebar').attr('id','nav-topbar');
|
||||
$('#nav-topbar').off();
|
||||
$('span.submenu_expand').remove();
|
||||
$('.expanded').removeClass('expanded');
|
||||
|
||||
$('#nav-topbar').on('mouseenter', 'li.maintab.has_submenu',
|
||||
function(){
|
||||
$(this).addClass('expanded');
|
||||
});
|
||||
$('#nav-topbar').on('mouseleave', 'li.maintab.has_submenu',
|
||||
function(){
|
||||
$(this).removeClass('expanded');
|
||||
});
|
||||
$('#nav-topbar').on('mouseenter', 'li.maintab.has_submenu',
|
||||
function(){
|
||||
$(this).addClass('expanded');
|
||||
});
|
||||
$('#nav-topbar').on('mouseleave', 'li.maintab.has_submenu',
|
||||
function(){
|
||||
$(this).removeClass('expanded');
|
||||
});
|
||||
|
||||
//todo hide element over menu width on load
|
||||
$('#nav-topbar').find('li.maintab').each(
|
||||
function(){
|
||||
if ($(this).position().top > 0) {
|
||||
$(this).addClass('hide');
|
||||
}
|
||||
});
|
||||
//todo hide element over menu width on load
|
||||
$('#nav-topbar').find('li.maintab').each(
|
||||
function(){
|
||||
if ($(this).position().top > 0) {
|
||||
$(this).addClass('hide');
|
||||
}
|
||||
});
|
||||
|
||||
//todo hide element over menu width on resize
|
||||
$(window).on('resize', function() {
|
||||
$('#nav-topbar ul.menu').find('li.maintab').each(function(){
|
||||
if ($(this).position().top > 0) {
|
||||
$(this).addClass('hide');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
//todo hide element over menu width on resize
|
||||
$(window).on('resize', function() {
|
||||
$('#nav-topbar ul.menu').find('li.maintab').each(function(){
|
||||
if ($(this).position().top > 0) {
|
||||
$(this).addClass('hide');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//nav switch
|
||||
function navSwitch(){
|
||||
if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed')) {
|
||||
navTopbar();
|
||||
} else {
|
||||
navSidebar();
|
||||
}
|
||||
}
|
||||
//nav switch
|
||||
function navSwitch(){
|
||||
if ($('body').hasClass('page-sidebar')||$('body').hasClass('page-sidebar-closed'))
|
||||
navTopbar();
|
||||
else
|
||||
navSidebar();
|
||||
}
|
||||
|
||||
//init menu
|
||||
if ($('body').hasClass('page-sidebar')){
|
||||
navSidebar();
|
||||
} else if($('body').hasClass('page-topbar')) {
|
||||
navTopbar();
|
||||
}
|
||||
//init menu
|
||||
if ($('body').hasClass('page-sidebar'))
|
||||
navSidebar();
|
||||
else if ($('body').hasClass('page-topbar'))
|
||||
navTopbar();
|
||||
|
||||
//tooltip
|
||||
$('.label-tooltip').tooltip();
|
||||
//tooltip
|
||||
$('.label-tooltip').tooltip();
|
||||
|
||||
//sidebar menu collapse
|
||||
$('.menu-collapse').click(function(){
|
||||
$('body').toggleClass('page-sidebar-closed');
|
||||
$('.expanded').removeClass('expanded');
|
||||
});
|
||||
//sidebar menu collapse
|
||||
$('.menu-collapse').click(function(){
|
||||
$('body').toggleClass('page-sidebar-closed');
|
||||
$('.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>
|
||||
{if $display_footer}
|
||||
{hook h="displayBackOfficeFooter"}
|
||||
<div id="footer">
|
||||
<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>
|
||||
</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 id="footer">
|
||||
<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>
|
||||
</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}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user