27 lines
1.2 KiB
JavaScript
27 lines
1.2 KiB
JavaScript
(function ( factory ) {
|
|
if ( typeof define === 'function' && define.amd )
|
|
{
|
|
// AMD. Register as an anonymous module.
|
|
define( [ 'jquery' ], factory );
|
|
}
|
|
else if ( typeof exports === 'object' )
|
|
{
|
|
// Node/CommonJS
|
|
factory( require( 'jquery' ) );
|
|
}
|
|
else
|
|
{
|
|
// Browser globals
|
|
factory( jQuery );
|
|
}
|
|
}( function ( jQuery ) {
|
|
|
|
|
|
/*
|
|
* jQuery mmenu backButton addon
|
|
* mmenu.frebsite.nl
|
|
*
|
|
* Copyright (c) Fred Heusschen
|
|
*/
|
|
!function(o){var t="mmenu",n="backButton";o[t].addons[n]={setup:function(){if(this.opts.offCanvas){var i=this,e=this.opts[n];if(this.conf[n],a=o[t].glbl,"boolean"==typeof e&&(e={close:e}),"object"!=typeof e&&(e={}),e=o.extend(!0,{},o[t].defaults[n],e),e.close){var c="#"+i.$menu.attr("id");this.bind("opened",function(){location.hash!=c&&history.pushState(null,document.title,c)}),o(window).on("popstate",function(o){a.$html.hasClass(s.opened)?(o.stopPropagation(),i.close()):location.hash==c&&(o.stopPropagation(),i.open())})}}},add:function(){return window.history&&window.history.pushState?(s=o[t]._c,i=o[t]._d,e=o[t]._e,void 0):(o[t].addons[n].setup=function(){},void 0)},clickAnchor:function(){}},o[t].defaults[n]={close:!1};var s,i,e,a}(jQuery);
|
|
})); |