| Server IP : 38.190.208.107 / Your IP : 216.73.216.187 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.11/wp-content/themes/consultstreet/assets/js/smartmenus/ |
Upload File : |
/*!
* SmartMenus jQuery Plugin Bootstrap 4 Addon - v0.1.0 - September 17, 2017
* http://www.smartmenus.org/
*
* Copyright Vasil Dinkov, Vadikom Web Ltd.
* http://vadikom.com
*
* Licensed MIT
*/
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery', 'smartmenus'], factory);
} else if (typeof module === 'object' && typeof module.exports === 'object') {
// CommonJS
module.exports = factory(require('jquery'));
} else {
// Global jQuery
factory(jQuery);
}
} (function($) {
$.extend($.SmartMenus.Bootstrap = {}, {
keydownFix: false,
init: function() {
// init all navbars that don't have the "data-sm-skip" attribute set
var $navbars = $('ul.navbar-nav:not([data-sm-skip])');
$navbars.each(function() {
var $this = $(this),
obj = $this.data('smartmenus');
// if this navbar is not initialized
if (!obj) {
var skipBehavior = $this.is('[data-sm-skip-collapsible-behavior]'),
rightAligned = $this.hasClass('ml-auto') || $this.prevAll('.mr-auto').length > 0;
$this.smartmenus({
// these are some good default options that should work for all
subMenusSubOffsetX: 2,
subMenusSubOffsetY: -9,
subIndicators: !skipBehavior,
collapsibleShowFunction: null,
collapsibleHideFunction: null,
rightToLeftSubMenus: rightAligned,
bottomToTopSubMenus: $this.closest('.fixed-bottom').length > 0
// custom option(s) for the Bootstrap 4 addon
//bootstrapHighlightClasses: 'text-dark bg-light'
})
.on({
// set/unset proper Bootstrap classes for some menu elements
'show.smapi': function(e, menu) {
var $menu = $(menu),
$scrollArrows = $menu.dataSM('scroll-arrows');
if ($scrollArrows) {
$scrollArrows.css('background-color', $menu.css('background-color'));
}
$menu.parent().addClass('show');
if (obj.opts.keepHighlighted && $menu.dataSM('level') > 2) {
$menu.prevAll('a').addClass(obj.opts.bootstrapHighlightClasses);
}
},
'hide.smapi': function(e, menu) {
var $menu = $(menu);
$menu.parent().removeClass('show');
if (obj.opts.keepHighlighted && $menu.dataSM('level') > 2) {
$menu.prevAll('a').removeClass(obj.opts.bootstrapHighlightClasses);
}
}
});
obj = $this.data('smartmenus');
function onInit() {
// set Bootstrap's "active" class to SmartMenus "current" items (should someone decide to enable markCurrentItem: true)
$this.find('a.current').each(function() {
var $this = $(this);
// dropdown items require the class to be set to the A's while for nav items it should be set to the parent LI's
($this.hasClass('dropdown-item') ? $this : $this.parent()).addClass('active');
});
// parent items fixes
$this.find('a.has-submenu').each(function() {
var $this = $(this);
// remove Bootstrap required attributes that might cause conflicting issues with the SmartMenus script
if ($this.is('[data-toggle="dropdown"]')) {
$this.dataSM('bs-data-toggle-dropdown', true).removeAttr('data-toggle');
}
// remove Bootstrap's carets generating class
if (!skipBehavior && $this.hasClass('dropdown-toggle')) {
$this.dataSM('bs-dropdown-toggle', true).removeClass('dropdown-toggle');
}
});
}
onInit();
function onBeforeDestroy() {
$this.find('a.current').each(function() {
var $this = $(this);
($this.hasClass('active') ? $this : $this.parent()).removeClass('active');
});
$this.find('a.has-submenu').each(function() {
var $this = $(this);
if ($this.dataSM('bs-dropdown-toggle')) {
$this.addClass('dropdown-toggle').removeDataSM('bs-dropdown-toggle');
}
if ($this.dataSM('bs-data-toggle-dropdown')) {
$this.attr('data-toggle', 'dropdown').removeDataSM('bs-data-toggle-dropdown');
}
});
}
// custom "refresh" method for Bootstrap
obj.refresh = function() {
$.SmartMenus.prototype.refresh.call(this);
onInit();
// update collapsible detection
detectCollapsible(true);
};
// custom "destroy" method for Bootstrap
obj.destroy = function(refresh) {
onBeforeDestroy();
$.SmartMenus.prototype.destroy.call(this, refresh);
};
// keep Bootstrap's default behavior (i.e. use the whole item area just as a sub menu toggle)
if (skipBehavior) {
obj.opts.collapsibleBehavior = 'toggle';
}
// onresize detect when the navbar becomes collapsible and add it the "sm-collapsible" class
var winW;
function detectCollapsible(force) {
var newW = obj.getViewportWidth();
if (newW != winW || force) {
if (obj.isCollapsible()) {
$this.addClass('sm-collapsible');
} else {
$this.removeClass('sm-collapsible');
}
winW = newW;
}
}
detectCollapsible();
$(window).on('resize.smartmenus' + obj.rootId, detectCollapsible);
}
});
// keydown fix for Bootstrap 4 conflict
if ($navbars.length && !$.SmartMenus.Bootstrap.keydownFix) {
// unhook BS keydown handler for all dropdowns
$(document).off('keydown.bs.dropdown.data-api', '.dropdown-menu');
// restore BS keydown handler for dropdowns that are not inside SmartMenus navbars
// SmartMenus won't add the "show" class so it's handy here
if ($.fn.dropdown && $.fn.dropdown.Constructor) {
$(document).on('keydown.bs.dropdown.data-api', '.dropdown-menu.show', $.fn.dropdown.Constructor._dataApiKeydownHandler);
}
$.SmartMenus.Bootstrap.keydownFix = true;
}
}
});
// init ondomready
$($.SmartMenus.Bootstrap.init);
return $;
}));