{* * Copyright (c) 2004-2021 OIC Group, Inc. * * This file is part of Exponent * * Exponent is free software; you can redistribute * it and/or modify it under the terms of the GNU * General Public License as published by the Free * Software Foundation; either version 2 of the * License, or (at your option) any later version. * * GPL: http://www.gnu.org/licenses/gpl.txt * *} {css unique="z-dropdown-bootstrap" lesscss="`$asset_path`less/dropdown-bootstrap.less"} {/css} {css unique="mega" lesscss="`$asset_path`less/yamm.less"} {/css} {script unique="dialog-`$__loc->src`" jquery="bootstrap-dialog" bootstrap="modal,transition"} {literal} $('#topnavbar a.loginpopup').click(function(e) { BootstrapDialog.show({ title: e.target.title, message: function(dialog) { var $message = $('
'); var pageToLoad = dialog.getData('pageToLoad'); $message.load(pageToLoad); return $message; }, data: { 'pageToLoad': EXPONENT.PATH_RELATIVE + "index.php?controller=login&action=showlogin&ajax_action=1" } }); e.preventDefault(); }); {/literal} {/script} {script unique="navbar-fix" bootstrap="dropdown,collapse,transition"} {literal} $('.dropdown-toggle').click(function(e) { e.preventDefault(); setTimeout($.proxy(function() { if ('ontouchstart' in document.documentElement) { $(this).siblings('.dropdown-backdrop').off().remove(); } }, this), 0); }); $(document).on('click', '.yamm .dropdown-menu', function(e) { e.stopPropagation() }); /** * NAME: Bootstrap 3 Triple Nested Sub-Menus * This script will active Triple level multi drop-down menus in Bootstrap 3.* */ $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { // Avoid following the href location when clicking event.preventDefault(); if ($(this).hasClass('tick')) { $(this).removeClass('tick'); $(this).parent().removeClass('open'); if ($(this).hasClass('exp-trigger')) { // Avoid having the menu to close when clicking event.stopPropagation(); } } else { $(this).addClass('tick'); // Avoid having the menu to close when clicking event.stopPropagation(); // Re-add .open to parent sub-menu item $(this).parent().addClass('open'); $(this).parent().find("ul").parent().find("li.dropdown").addClass('open'); } }); /** * Auto-adjust (dynamically) top margins based on navbar type and slingbar display */ $(document).ready(function(){ function setTopPadding() { if ({/literal}{($user->getsToolbar == 1 && $smarty.const.SLINGBAR_TOP == 1)?1:0}{literal}) { $adminbar = $('#admin-toolbar').outerHeight(); if ($adminbar == 0) $adminbar = 50; } else { $adminbar = 0; } if ($(document.body).width() >= {/literal}{$smarty.const.MENU_WIDTH}{literal} - 15) { // non-collapsed navbar if ($('#topnavbar.navbar-fixed-top').length != 0) { // fixed top menu // $(document.body).css('padding-top', $('#topnavbar').outerHeight() + 10 + $adminbar); $('#topnavbar.navbar-fixed-top').css('margin-top', $adminbar); $(document.body).css('margin-top', $('#topnavbar').outerHeight() + $adminbar); } else if ($('#topnavbar.navbar-static-top').length != 0) { // static top menu $(document.body).css('padding-top', 0); // $('#topnavbar.navbar-static-top').css('margin-top', $adminbar); } else if ($('#topnavbar.navbar-fixed-bottom').length != 0) { // fixed bottom menu $(document.body).css('padding-top', $adminbar); $('#topnavbar.navbar-fixed-bottom').css('margin-top', 0); $(document.body).css('padding-bottom', $('#topnavbar').outerHeight() - 45); } } else { // collapsed navbar if ($('#topnavbar.navbar-fixed-top').length != 0) { // fixed top menu // $(document.body).css('padding-top', $adminbar + $('#topnavbar').outerHeight()); $('#topnavbar.navbar-fixed-top').css('margin-top', $adminbar); $(document.body).css('margin-top', $('#topnavbar').outerHeight() + $adminbar); } else if ($('#topnavbar.navbar-static-top').length != 0) { // static top menu // $(document.body).css('padding-top', $adminbar); // $('#topnavbar.navbar-static-top').css('margin-top', $adminbar); } else if ($('#topnavbar.navbar-fixed-bottom').length != 0) { // fixed bottom menu $(document.body).css('padding-top', $adminbar); $(document.body).css('padding-bottom', 0); } } }; setTopPadding(); $(window).resize(function(){ setTopPadding(); }); }); {/literal} {/script}