Version Description
Download this release
Release Info
Developer | sevenspark |
Plugin | ShiftNav – Responsive Mobile Menu |
Version | 1.5.1.2 |
Comparing to | |
See all releases |
Code changes from version 1.5.1.1 to 1.5.1.2
- assets/js/shiftnav.js +19 -7
- assets/js/shiftnav.min.js +25 -25
- includes/ShiftNavWalker.class.php +6 -1
- shiftnav-responsive-mobile-menu.php +2 -2
assets/js/shiftnav.js
CHANGED
@@ -320,7 +320,7 @@
|
|
320 |
var scrolltarget = $(this).data( 'shiftnav-scrolltarget' );
|
321 |
if( scrolltarget ){
|
322 |
var $target = $( scrolltarget ).first();
|
323 |
-
if( $target.
|
324 |
//Make current
|
325 |
var $li = $(this).parent('.menu-item');
|
326 |
$li.siblings().removeClass( 'current-menu-item' ).removeClass( 'current-menu-ancestor' );
|
@@ -426,8 +426,20 @@
|
|
426 |
}
|
427 |
else{
|
428 |
//console.log('open shift nav');
|
429 |
-
var
|
430 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
431 |
}
|
432 |
|
433 |
//Temporarily disable toggle for click event when touch is fired
|
@@ -632,7 +644,7 @@
|
|
632 |
//Don't fire during transtion
|
633 |
if( $( 'body' ).is( '.shiftnav-transitioning' ) ) return;
|
634 |
|
635 |
-
if( $(e.target).parents().add( $(e.target) ).filter( '.shiftnav, .shiftnav-toggle, .shiftnav-ignore' ).
|
636 |
|
637 |
|
638 |
if( plugin.settings.debug ) console.log( 'touchoff close ', e );
|
@@ -741,7 +753,7 @@
|
|
741 |
|
742 |
//Shift Sub Specific
|
743 |
if( $li.hasClass( 'shiftnav-sub-shift' ) ){
|
744 |
-
if( $li.parents( '.shiftnav-sub-shift' ).
|
745 |
|
746 |
//return to original position
|
747 |
var y = $li.data( 'scroll-back' );
|
@@ -848,7 +860,7 @@
|
|
848 |
if( window.location.hash.substring(1,2) == '.' ){
|
849 |
var $scrollTarget = $( window.location.hash.substring(1) );
|
850 |
var top = $scrollTarget.offset().top - shiftnav_data.scroll_offset;
|
851 |
-
if( $scrollTarget.
|
852 |
}
|
853 |
|
854 |
if( window.location.hash ){
|
@@ -857,7 +869,7 @@
|
|
857 |
if( hash.substring(1,2) == '.' ) hash = hash.substring(1);
|
858 |
//console.log( '.shiftnav .shiftnav-target[data-shiftnav-scrolltarget='+hash+']' );
|
859 |
var $li = $( '.shiftnav .shiftnav-target[data-shiftnav-scrolltarget="'+hash+'"]' ).parent();
|
860 |
-
if( $li.
|
861 |
//console.log( $li );
|
862 |
$li.siblings().removeClass( 'current-menu-item' ).removeClass( 'current-menu-ancestor' );
|
863 |
$li.addClass( 'current-menu-item' );
|
320 |
var scrolltarget = $(this).data( 'shiftnav-scrolltarget' );
|
321 |
if( scrolltarget ){
|
322 |
var $target = $( scrolltarget ).first();
|
323 |
+
if( $target.length > 0 ){
|
324 |
//Make current
|
325 |
var $li = $(this).parent('.menu-item');
|
326 |
$li.siblings().removeClass( 'current-menu-item' ).removeClass( 'current-menu-ancestor' );
|
426 |
}
|
427 |
else{
|
428 |
//console.log('open shift nav');
|
429 |
+
var toggle_id = $toggle.attr( 'id' );
|
430 |
+
var tag = toggle_id == 'shiftnav-toggle-main' ? '[Main Toggle Bar]' : '"'+$(this).text()+'"';
|
431 |
+
|
432 |
+
//When clicking on main toggle, and the menu is open,
|
433 |
+
//but it's not the main panel, close whichever panel is actually open instead
|
434 |
+
if( ( ( toggle_id == 'shiftnav-toggle-main-button' ) ||
|
435 |
+
( toggle_id == 'shiftnav-toggle-main' ) ) &&
|
436 |
+
$( 'body' ).hasClass( 'shiftnav-open' ) ){
|
437 |
+
//Close all shiftnavs
|
438 |
+
$( '.shiftnav.shiftnav-open-target' ).shiftnav( 'closeShiftNav' );
|
439 |
+
}
|
440 |
+
else{
|
441 |
+
plugin.openShiftNav( 'toggle: ' + tag );
|
442 |
+
}
|
443 |
}
|
444 |
|
445 |
//Temporarily disable toggle for click event when touch is fired
|
644 |
//Don't fire during transtion
|
645 |
if( $( 'body' ).is( '.shiftnav-transitioning' ) ) return;
|
646 |
|
647 |
+
if( $(e.target).parents().add( $(e.target) ).filter( '.shiftnav, .shiftnav-toggle, .shiftnav-ignore' ).length === 0 ){
|
648 |
|
649 |
|
650 |
if( plugin.settings.debug ) console.log( 'touchoff close ', e );
|
753 |
|
754 |
//Shift Sub Specific
|
755 |
if( $li.hasClass( 'shiftnav-sub-shift' ) ){
|
756 |
+
if( $li.parents( '.shiftnav-sub-shift' ).length == 0 ) plugin.$shiftnav.removeClass( 'shiftnav-sub-shift-active' );
|
757 |
|
758 |
//return to original position
|
759 |
var y = $li.data( 'scroll-back' );
|
860 |
if( window.location.hash.substring(1,2) == '.' ){
|
861 |
var $scrollTarget = $( window.location.hash.substring(1) );
|
862 |
var top = $scrollTarget.offset().top - shiftnav_data.scroll_offset;
|
863 |
+
if( $scrollTarget.length ) window.scrollTo( 0 , top );
|
864 |
}
|
865 |
|
866 |
if( window.location.hash ){
|
869 |
if( hash.substring(1,2) == '.' ) hash = hash.substring(1);
|
870 |
//console.log( '.shiftnav .shiftnav-target[data-shiftnav-scrolltarget='+hash+']' );
|
871 |
var $li = $( '.shiftnav .shiftnav-target[data-shiftnav-scrolltarget="'+hash+'"]' ).parent();
|
872 |
+
if( $li.length ){
|
873 |
//console.log( $li );
|
874 |
$li.siblings().removeClass( 'current-menu-item' ).removeClass( 'current-menu-ancestor' );
|
875 |
$li.addClass( 'current-menu-item' );
|
assets/js/shiftnav.min.js
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
(function(b,
|
2 |
this.touchMove="MSPointerMove"):(this.touchStart="touchstart",this.touchEnd="touchend",this.touchMove="touchmove");this.toggleevent="touchend"==this.touchEnd?this.touchEnd+" click":this.touchEnd;this.transitionend="transitionend.shiftnav webkitTransitionEnd.shiftnav msTransitionEnd.shiftnav oTransitionEnd.shiftnav";this.settings.clicktest&&(this.touchEnd="click");this.init()}var p={mouseEvents:!0,retractors:!0,touchOffClose:!0,clicktest:!1,windowstest:!1,debug:!1,swipe_tolerance_x:150,swipe_tolerance_y:30,
|
3 |
swipe_edge_proximity:70,open_current:!1,collapse_accordions:!1,scroll_offset:100,disable_transforms:!1};k.prototype={init:function(){this.$shiftnav.removeClass("shiftnav-nojs");this.$toggles=b('.shiftnav-toggle[data-shiftnav-target="'+this.$shiftnav.data("shiftnav-id")+'"]');this.initializeShiftNav();this.initializeTargets();this.initializeSubmenuToggleMouseEvents();this.initializeRetractors();this.initializeResponsiveToggle();this.initializeSwipeHandler()},initializeShiftNav:function(){var a=b("body"),
|
4 |
d=this;if(!a.hasClass("shiftnav-enabled")){a.addClass("shiftnav-enabled");"on"==shiftnav_data.lock_body&&a.addClass("shiftnav-lock");"on"==shiftnav_data.lock_body_x&&a.addClass("shiftnav-lock-x");"off"!=shiftnav_data.shift_body?""!=shiftnav_data.shift_body_wrapper?b(shiftnav_data.shift_body_wrapper).addClass("shiftnav-wrap"):(a.wrapInner('<div class="shiftnav-wrap"></div>'),b("video[autoplay]").each(function(){b(this).get(0).play()})):a.addClass("shiftnav-disable-shift-body");b("#shiftnav-toggle-main, #wpadminbar, .shiftnav-fixed-left, .shiftnav-fixed-right").appendTo("body");
|
5 |
-
var c=b(".shiftnav-wrap"),
|
6 |
-
/chrome/.test(e)?
|
7 |
-
function(a){k=a.originalEvent.changedTouches[0].pageX;
|
8 |
-
|
9 |
function(a){b(".shiftnav-searchbar-drop").removeClass("shiftnav-searchbar-drop-open");b("body").off("click.shiftnav-searchbar-drop")})},100))});b(".shiftnav-searchbar-drop").on(this.toggleevent,function(a){a.stopPropagation()});b(".shiftnav-searchbar-drop .shiftnav-search-input").on("blur",function(a){""!=b(this).val()||q||b(this).parents(".shiftnav-searchbar-drop").removeClass("shiftnav-searchbar-drop-open")});var q;b(".shiftnav-searchbar-toggle").on("mousedown",function(a){q=!0});b(".shiftnav-searchbar-toggle").on("mouseup",
|
10 |
-
function(a){q=!1});b(".shiftnav").css("max-height",
|
11 |
-
b(this).css({height:a,width:a})});d.settings.open_current&&b(".shiftnav .shiftnav-sub-accordion.current-menu-item, .shiftnav .shiftnav-sub-accordion.current-menu-ancestor").addClass("shiftnav-active")},initializeTargets:function(){var a=this;this.$shiftnav.find(".shiftnav-scrollto").removeClass("current-menu-item").removeClass("current-menu-ancestor");this.$shiftnav.on("click",".shiftnav-target",function(d){var c=b(this).data("shiftnav-scrolltarget");if(c){var
|
12 |
-
b(this).parent(".menu-item"),d.siblings().removeClass("current-menu-item").removeClass("current-menu-ancestor"),d.addClass("current-menu-item"),d=
|
13 |
a):a.openSubmenu(d,"disabledLink",a))})},initializeSubmenuToggleMouseEvents:function(){if(this.settings.mouseEvents&&!this.settings.clicktest&&!this.settings.windowstest){this.settings.debug&&console.log("initializeSubmenuToggleMouseEvents");var a=this;this.$shiftnav.on("mouseup.shift-submenu-toggle",".shiftnav-submenu-activation",function(b){a.handleMouseActivation(b,this,a)})}},disableSubmenuToggleMouseEvents:function(){this.settings.debug&&console.log("disableSubmenuToggleMouseEvents");$shiftnav.off("mouseover.shift-submenu-toggle");
|
14 |
$shiftnav.off("mouseout.shift-submenu-toggle")},initializeRetractors:function(){if(this.settings.retractors){var a=this;this.$shiftnav.on("mouseup.shiftnav",".shiftnav-retract",function(b){a.handleSubmenuRetractorEnd(b,this,a)})}},initializeResponsiveToggle:function(){var a=this;this.$toggles.on("click","a",function(a){a.stopPropagation()});this.$toggles.on("click",function(d){a.toggle(b(this),a,d)})},toggle:function(a,d,c){c.preventDefault();c.stopPropagation();if("click"!=c.originalEvent.type||
|
15 |
-
!b(this).data("disableToggle"))
|
16 |
-
function(b){a=b.originalEvent.changedTouches[0].pageY;d=b.originalEvent.changedTouches[0].pageX});
|
17 |
-
|
18 |
-
Math.abs(c-a)<
|
19 |
-
b(this).off(d.transitionend)});this.disableTouchoffClose();this.initializeTouchoffClose()},closeShiftNav:function(){var a=this;b("body").removeClass(this.openclass).addClass("shiftnav-transitioning");this.$shiftnav.removeClass("shiftnav-open-target").on(a.transitionend,function(){b("body").removeClass("shiftnav-transitioning");b(this).off(a.transitionend)});this.disableTouchoffClose()},
|
20 |
-
".shiftnav",function(b){a.handleTouchoffClose(b,this,a)})}},disableTouchoffClose:function(){b(
|
21 |
-
console.log("handleSubmenuRetractorEnd "+a.find("> a").text())},handleTouchoffClose:function(a,d,c){b("body").is(".shiftnav-transitioning")||0!==b(a.target).parents().add(b(a.target)).filter(".shiftnav, .shiftnav-toggle, .shiftnav-ignore").
|
22 |
-
this.$shiftnav.find(".shiftnav-inner").scrollTop(a)},openSubmenu:function(a,b,c){a.hasClass("shiftnav-active")||(a.hasClass("shiftnav-sub-shift")?(a.siblings(".shiftnav-active").removeClass("shiftnav-active"),a.toggleClass("shiftnav-caulk"),c.$shiftnav.addClass("shiftnav-sub-shift-active")):c.settings.collapse_accordions&&a.siblings(".shiftnav-active").removeClass("shiftnav-active"),
|
23 |
-
setTimeout(function(){a.addClass("shiftnav-active");a.trigger("shiftnav-open-submenu");a.removeClass("shiftnav-caulk");setTimeout(function(){var b=c.scrollPanel();a.data("scroll-back",b);b=a.offset().top+b;c.scrollPanel(b)},100)},1))},closeSubmenu:function(a,d,c){this.settings.debug&&console.log("closeSubmenu "+a.find(">a").text()+" ["+d+"]");a.hasClass("menu-item-has-children")&&
|
24 |
-
e.on(c.transitionend+"_closesubmenu",function(){c.settings.debug&&console.log("finished submenu close transition");a.removeClass("shiftnav-in-transition");e.off(c.transitionend+"_closesubmenu")});c.closeSubmenu(a.find(".shiftnav-active"),d+"_recursive",c)}));a.removeClass("shiftnav-active");if(a.hasClass("shiftnav-sub-shift")){0==a.parents(".shiftnav-sub-shift").
|
25 |
-
a.closest("ul").addClass("shiftnav-sub-active-current");a.trigger("shiftnav-close-submenu")},closeAllSubmenus:function(){b(this.element).find("li.menu-item-has-children").removeClass("shiftnav-active")}};b.fn.shiftnav=function(a){var d=arguments;if(a===e||"object"===typeof a)return this.each(function(){b.data(this,"plugin_shiftnav")||b.data(this,
|
26 |
-
k&&"function"===typeof e[a]&&(c=e[a].apply(e,Array.prototype.slice.call(d,1)));"destroy"===a&&b.data(this,"plugin_shiftnav",null)});return c!==e?c:this}}})(jQuery,window,document);
|
27 |
-
(function(b){function
|
28 |
-
touchOffClose:"on"==shiftnav_data.touch_off_close?!0:!1,scroll_offset:shiftnav_data.scroll_offset,disable_transforms:"on"==shiftnav_data.disable_transforms?!0:!1});if("."==window.location.hash.substring(1,2)){e=b(window.location.hash.substring(1));var
|
29 |
-
(e.siblings().removeClass("current-menu-item").removeClass("current-menu-ancestor"),e.addClass("current-menu-item")));b(".shiftnav").trigger("shiftnav-loaded")}}var
|
30 |
-
(function(b,
|
31 |
-
var shift_supports=function(){var b=document.createElement("div"),
|
1 |
+
(function(b,g,h,e){function k(a,d){this.element=a;this.$shiftnav=b(this.element);this.$menu=this.$shiftnav.find("ul.shiftnav-menu");this.settings=b.extend({},p,d);this._defaults=p;this._name="shiftnav";this.touchenabled="ontouchstart"in g||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints;g.navigator.pointerEnabled?(this.touchStart="pointerdown",this.touchEnd="pointerup",this.touchMove="pointermove"):g.navigator.msPointerEnabled?(this.touchStart="MSPointerDown",this.touchEnd="MSPointerUp",
|
2 |
this.touchMove="MSPointerMove"):(this.touchStart="touchstart",this.touchEnd="touchend",this.touchMove="touchmove");this.toggleevent="touchend"==this.touchEnd?this.touchEnd+" click":this.touchEnd;this.transitionend="transitionend.shiftnav webkitTransitionEnd.shiftnav msTransitionEnd.shiftnav oTransitionEnd.shiftnav";this.settings.clicktest&&(this.touchEnd="click");this.init()}var p={mouseEvents:!0,retractors:!0,touchOffClose:!0,clicktest:!1,windowstest:!1,debug:!1,swipe_tolerance_x:150,swipe_tolerance_y:30,
|
3 |
swipe_edge_proximity:70,open_current:!1,collapse_accordions:!1,scroll_offset:100,disable_transforms:!1};k.prototype={init:function(){this.$shiftnav.removeClass("shiftnav-nojs");this.$toggles=b('.shiftnav-toggle[data-shiftnav-target="'+this.$shiftnav.data("shiftnav-id")+'"]');this.initializeShiftNav();this.initializeTargets();this.initializeSubmenuToggleMouseEvents();this.initializeRetractors();this.initializeResponsiveToggle();this.initializeSwipeHandler()},initializeShiftNav:function(){var a=b("body"),
|
4 |
d=this;if(!a.hasClass("shiftnav-enabled")){a.addClass("shiftnav-enabled");"on"==shiftnav_data.lock_body&&a.addClass("shiftnav-lock");"on"==shiftnav_data.lock_body_x&&a.addClass("shiftnav-lock-x");"off"!=shiftnav_data.shift_body?""!=shiftnav_data.shift_body_wrapper?b(shiftnav_data.shift_body_wrapper).addClass("shiftnav-wrap"):(a.wrapInner('<div class="shiftnav-wrap"></div>'),b("video[autoplay]").each(function(){b(this).get(0).play()})):a.addClass("shiftnav-disable-shift-body");b("#shiftnav-toggle-main, #wpadminbar, .shiftnav-fixed-left, .shiftnav-fixed-right").appendTo("body");
|
5 |
+
var c=b(".shiftnav-wrap"),f=b("#shiftnav-toggle-main");if(!f.hasClass("shiftnav-toggle-style-burger_only")&&f.hasClass("shiftnav-togglebar-gap-auto")||f.hasClass("shiftnav-togglebar-gap-on")){var e=f.outerHeight();c.css("padding-top",e);f.addClass("shiftnav-togglebar-gap-on");"off"==shiftnav_data.shift_body&&a.css("padding-top",e)}else b("body").hasClass("admin-bar")&&b("html").addClass("shiftnav-nogap");f=!1;e=navigator.userAgent.toLowerCase();/android/.test(e)&&(f=!0,/android [1-3]/.test(e)?f=!0:
|
6 |
+
/chrome/.test(e)?f=!1:/firefox/.test(e)&&(f=!1));(!shift_supports("transform")||f||d.settings.disable_transforms)&&a.addClass("shiftnav-no-transforms");if("on"==shiftnav_data.swipe_open){var h=0,n=0,l=0,k=0,m=b(g).width();"off"==shiftnav_data.shift_body&&(c=b("body"));c.on("touchstart",function(a){d.settings.breakpoint&&b(g).width()>d.settings.breakpoint||(h=a.originalEvent.changedTouches[0].pageY,n=a.originalEvent.changedTouches[0].pageX)});if(b("#shiftnav-main").hasClass("shiftnav-left-edge"))c.on("touchmove",
|
7 |
+
function(a){k=a.originalEvent.changedTouches[0].pageX;n<d.settings.swipe_edge_proximity&&(a.preventDefault(),k-n>d.settings.swipe_tolerance_x&&(l=a.originalEvent.changedTouches[0].pageY,Math.abs(l-h)<d.settings.swipe_tolerance_y&&(d.openShiftNav("swipe right"),a.stopPropagation())))});else c.on("touchmove",function(a){k=a.originalEvent.changedTouches[0].pageX;n>m-d.settings.swipe_edge_proximity&&(a.preventDefault(),n-k>d.settings.swipe_tolerance_x&&(l=a.originalEvent.changedTouches[0].pageY,Math.abs(l-
|
8 |
+
h)<d.settings.swipe_tolerance_y&&(d.openShiftNav("swipe left"),a.stopPropagation())))})}b(".shiftnav-searchbar-toggle").on(this.toggleevent,function(a){a.stopPropagation();a.preventDefault();a=b(this).next(".shiftnav-searchbar-drop");a.hasClass("shiftnav-searchbar-drop-open")?(a.removeClass("shiftnav-searchbar-drop-open"),b("body").off("click.shiftnav-searchbar-drop")):(a.addClass("shiftnav-searchbar-drop-open"),a.find(".shiftnav-search-input").focus(),setTimeout(function(){b("body").on("click.shiftnav-searchbar-drop",
|
9 |
function(a){b(".shiftnav-searchbar-drop").removeClass("shiftnav-searchbar-drop-open");b("body").off("click.shiftnav-searchbar-drop")})},100))});b(".shiftnav-searchbar-drop").on(this.toggleevent,function(a){a.stopPropagation()});b(".shiftnav-searchbar-drop .shiftnav-search-input").on("blur",function(a){""!=b(this).val()||q||b(this).parents(".shiftnav-searchbar-drop").removeClass("shiftnav-searchbar-drop-open")});var q;b(".shiftnav-searchbar-toggle").on("mousedown",function(a){q=!0});b(".shiftnav-searchbar-toggle").on("mouseup",
|
10 |
+
function(a){q=!1});b(".shiftnav").css("max-height",g.innerHeight);b(g).shiftsmartresize(function(){b(".shiftnav").css("max-height",g.innerHeight)})}this.$shiftnav.appendTo("body");this.$shiftnav.hasClass("shiftnav-right-edge")?this.edge="right":this.edge="left";this.openclass="shiftnav-open shiftnav-open-"+this.edge;this.$shiftnav.find(".shiftnav-panel-close").on("click",function(){d.closeShiftNav()});this.$shiftnav.find(".shiftnav-submenu-activation").each(function(){var a=b(this).siblings(".shiftnav-target").outerHeight();
|
11 |
+
b(this).css({height:a,width:a})});d.settings.open_current&&b(".shiftnav .shiftnav-sub-accordion.current-menu-item, .shiftnav .shiftnav-sub-accordion.current-menu-ancestor").addClass("shiftnav-active")},initializeTargets:function(){var a=this;this.$shiftnav.find(".shiftnav-scrollto").removeClass("current-menu-item").removeClass("current-menu-ancestor");this.$shiftnav.on("click",".shiftnav-target",function(d){var c=b(this).data("shiftnav-scrolltarget");if(c){var f=b(c).first();if(0<f.length)return d=
|
12 |
+
b(this).parent(".menu-item"),d.siblings().removeClass("current-menu-item").removeClass("current-menu-ancestor"),d.addClass("current-menu-item"),d=f.offset().top,d-=a.settings.scroll_offset,b("html,body").animate({scrollTop:d},1E3,"swing",function(){a.closeShiftNav()}),!1;(f=b(this).attr("href"))&&-1==f.indexOf("#")&&(-1==c.indexOf("#")&&(c="#"+c),g.location=f+c,d.preventDefault())}else b(this).is("span")&&(d=b(this).parent(".menu-item"),d.hasClass("shiftnav-active")?a.closeSubmenu(d,"disabledLink",
|
13 |
a):a.openSubmenu(d,"disabledLink",a))})},initializeSubmenuToggleMouseEvents:function(){if(this.settings.mouseEvents&&!this.settings.clicktest&&!this.settings.windowstest){this.settings.debug&&console.log("initializeSubmenuToggleMouseEvents");var a=this;this.$shiftnav.on("mouseup.shift-submenu-toggle",".shiftnav-submenu-activation",function(b){a.handleMouseActivation(b,this,a)})}},disableSubmenuToggleMouseEvents:function(){this.settings.debug&&console.log("disableSubmenuToggleMouseEvents");$shiftnav.off("mouseover.shift-submenu-toggle");
|
14 |
$shiftnav.off("mouseout.shift-submenu-toggle")},initializeRetractors:function(){if(this.settings.retractors){var a=this;this.$shiftnav.on("mouseup.shiftnav",".shiftnav-retract",function(b){a.handleSubmenuRetractorEnd(b,this,a)})}},initializeResponsiveToggle:function(){var a=this;this.$toggles.on("click","a",function(a){a.stopPropagation()});this.$toggles.on("click",function(d){a.toggle(b(this),a,d)})},toggle:function(a,d,c){c.preventDefault();c.stopPropagation();if("click"!=c.originalEvent.type||
|
15 |
+
!b(this).data("disableToggle")){if(d.$shiftnav.hasClass("shiftnav-open-target"))d.closeShiftNav();else{a=a.attr("id");var f="shiftnav-toggle-main"==a?"[Main Toggle Bar]":'"'+b(this).text()+'"';"shiftnav-toggle-main-button"!=a&&"shiftnav-toggle-main"!=a||!b("body").hasClass("shiftnav-open")?d.openShiftNav("toggle: "+f):b(".shiftnav.shiftnav-open-target").shiftnav("closeShiftNav")}"click"!=c.originalEvent.type&&(b(this).data("disableToggle",!0),setTimeout(function(){b(this).data("disableToggle",!1)},
|
16 |
+
1E3));return!1}},initializeSwipeHandler:function(){b("body");var a=0,d=0,c=0,f=0,e=0,h=0,k=this,l=!1,p=b(g).height(),m=this.$shiftnav.find(".shiftnav-inner");m.on("touchstart",function(b){a=b.originalEvent.changedTouches[0].pageY;d=b.originalEvent.changedTouches[0].pageX});m.on(this.touchMove,function(b){l=!1;p>=m[0].scrollHeight?(l=!0,b.preventDefault()):0===b.currentTarget.scrollTop?(c=b.originalEvent.changedTouches[0].pageY,c>a&&(l=!0,b.preventDefault())):b.currentTarget.scrollHeight===b.currentTarget.scrollTop+
|
17 |
+
b.currentTarget.offsetHeight&&(c=b.originalEvent.changedTouches[0].pageY,c<a&&(l=!0,b.preventDefault()));l||(e=Math.abs(a-b.originalEvent.changedTouches[0].pageY),h=Math.abs(d-b.originalEvent.changedTouches[0].pageX),e<h&&b.preventDefault())});if("on"==shiftnav_data.swipe_close)if(this.$shiftnav.hasClass("shiftnav-right-edge"))m.on("touchmove",function(b){f=b.originalEvent.changedTouches[0].pageX;f-d>k.settings.swipe_tolerance_x&&Math.abs(c-a)<k.settings.swipe_tolerance_y&&(k.closeShiftNav(),b.preventDefault())});
|
18 |
+
else m.on("touchmove",function(b){f=b.originalEvent.changedTouches[0].pageX;d-f>k.settings.swipe_tolerance_x&&(c=b.originalEvent.changedTouches[0].pageY,Math.abs(c-a)<k.settings.swipe_tolerance_y&&(k.closeShiftNav(),b.preventDefault()));b.stopPropagation()})},openShiftNav:function(a){var d=this;this.settings.debug&&console.log("openShiftNav "+(a||"?"));b("body").removeClass("shiftnav-open-right shiftnav-open-left").addClass(this.openclass).addClass("shiftnav-transitioning");b(".shiftnav-open-target").removeClass("shiftnav-open-target");
|
19 |
+
this.$shiftnav.addClass("shiftnav-open-target").on(d.transitionend,function(){b("body").removeClass("shiftnav-transitioning");b(this).off(d.transitionend)});this.disableTouchoffClose();this.initializeTouchoffClose()},closeShiftNav:function(){var a=this;b("body").removeClass(this.openclass).addClass("shiftnav-transitioning");this.$shiftnav.removeClass("shiftnav-open-target").on(a.transitionend,function(){b("body").removeClass("shiftnav-transitioning");b(this).off(a.transitionend)});this.disableTouchoffClose()},
|
20 |
+
initializeTouchoffClose:function(){if(this.settings.touchOffClose){var a=this;b(h).on("click.shiftnav "+this.touchEnd+".shiftnav",function(b){a.handleTouchoffClose(b,this,a)})}},disableTouchoffClose:function(){b(h).off(".shiftnav")},handleMouseActivation:function(a,d,c){c.settings.debug&&console.log("handleMouseover, add mouseout",a);a=b(d).parent();a.hasClass("shiftnav-active")?c.closeSubmenu(a,"mouseActivate",c):c.openSubmenu(a,"mouseActivate",c)},handleSubmenuRetractorEnd:function(a,d,c){a.preventDefault();
|
21 |
+
a.stopPropagation();a=b(d).parent("ul").parent("li");c.closeSubmenu(a,"handleSubmenuRetractor",c);c.settings.debug&&console.log("handleSubmenuRetractorEnd "+a.find("> a").text())},handleTouchoffClose:function(a,d,c){b("body").is(".shiftnav-transitioning")||0!==b(a.target).parents().add(b(a.target)).filter(".shiftnav, .shiftnav-toggle, .shiftnav-ignore").length||(c.settings.debug&&console.log("touchoff close ",a),a.preventDefault(),a.stopPropagation(),c.closeShiftNav(),c.disableTouchoffClose())},scrollPanel:function(a){if("off"==
|
22 |
+
shiftnav_data.scroll_panel)return 0;if("undefined"==typeof a)return this.$shiftnav.find(".shiftnav-inner").scrollTop();this.$shiftnav.find(".shiftnav-inner").scrollTop(a)},openSubmenu:function(a,b,c){a.hasClass("shiftnav-active")||(a.hasClass("shiftnav-sub-shift")?(a.siblings(".shiftnav-active").removeClass("shiftnav-active"),a.toggleClass("shiftnav-caulk"),c.$shiftnav.addClass("shiftnav-sub-shift-active")):c.settings.collapse_accordions&&a.siblings(".shiftnav-active").removeClass("shiftnav-active"),
|
23 |
+
a.parents("ul").removeClass("shiftnav-sub-active-current"),a.find("> ul").addClass("shiftnav-sub-active").addClass("shiftnav-sub-active-current"),setTimeout(function(){a.addClass("shiftnav-active");a.trigger("shiftnav-open-submenu");a.removeClass("shiftnav-caulk");setTimeout(function(){var b=c.scrollPanel();a.data("scroll-back",b);b=a.offset().top+b;c.scrollPanel(b)},100)},1))},closeSubmenu:function(a,d,c){this.settings.debug&&console.log("closeSubmenu "+a.find(">a").text()+" ["+d+"]");a.hasClass("menu-item-has-children")&&
|
24 |
+
a.hasClass("shiftnav-active")&&(a.addClass("shiftnav-in-transition"),a.each(function(){var a=b(this),e=a.find("> ul");e.on(c.transitionend+"_closesubmenu",function(){c.settings.debug&&console.log("finished submenu close transition");a.removeClass("shiftnav-in-transition");e.off(c.transitionend+"_closesubmenu")});c.closeSubmenu(a.find(".shiftnav-active"),d+"_recursive",c)}));a.removeClass("shiftnav-active");if(a.hasClass("shiftnav-sub-shift")){0==a.parents(".shiftnav-sub-shift").length&&c.$shiftnav.removeClass("shiftnav-sub-shift-active");
|
25 |
+
var e=a.data("scroll-back");"undefined"!==e&&c.scrollPanel(e)}a.find("> ul").removeClass("shiftnav-sub-active").removeClass("shiftnav-sub-active-current");a.closest("ul").addClass("shiftnav-sub-active-current");a.trigger("shiftnav-close-submenu")},closeAllSubmenus:function(){b(this.element).find("li.menu-item-has-children").removeClass("shiftnav-active")}};b.fn.shiftnav=function(a){var d=arguments;if(a===e||"object"===typeof a)return this.each(function(){b.data(this,"plugin_shiftnav")||b.data(this,
|
26 |
+
"plugin_shiftnav",new k(this,a))});if("string"===typeof a&&"_"!==a[0]&&"init"!==a){var c;this.each(function(){var e=b.data(this,"plugin_shiftnav");e instanceof k&&"function"===typeof e[a]&&(c=e[a].apply(e,Array.prototype.slice.call(d,1)));"destroy"===a&&b.data(this,"plugin_shiftnav",null)});return c!==e?c:this}}})(jQuery,window,document);
|
27 |
+
(function(b){function g(e){if(!h){h=!0;"undefined"!=typeof console&&"window.load"==e&&console.log("ShiftNav initialized via "+e);b(".shiftnav-loading").remove();jQuery(".shiftnav").shiftnav({swipe_tolerance_x:parseInt(shiftnav_data.swipe_tolerance_x),swipe_tolerance_y:parseInt(shiftnav_data.swipe_tolerance_y),swipe_edge_proximity:parseInt(shiftnav_data.swipe_edge_proximity),open_current:"on"==shiftnav_data.open_current?!0:!1,collapse_accordions:"on"==shiftnav_data.collapse_accordions?!0:!1,breakpoint:parseInt(shiftnav_data.breakpoint),
|
28 |
+
touchOffClose:"on"==shiftnav_data.touch_off_close?!0:!1,scroll_offset:shiftnav_data.scroll_offset,disable_transforms:"on"==shiftnav_data.disable_transforms?!0:!1});if("."==window.location.hash.substring(1,2)){e=b(window.location.hash.substring(1));var k=e.offset().top-shiftnav_data.scroll_offset;e.length&&window.scrollTo(0,k)}window.location.hash&&(e=window.location.hash,"."==e.substring(1,2)&&(e=e.substring(1)),e=b('.shiftnav .shiftnav-target[data-shiftnav-scrolltarget="'+e+'"]').parent(),e.length&&
|
29 |
+
(e.siblings().removeClass("current-menu-item").removeClass("current-menu-ancestor"),e.addClass("current-menu-item")));b(".shiftnav").trigger("shiftnav-loaded")}}var h=!1;jQuery(function(b){g("document.ready")});b(window).on("load",function(){g("window.load")})})(jQuery);
|
30 |
+
(function(b,g){var h=function(b,k,g){var a;return function(){var d=this,c=arguments;a?clearTimeout(a):g&&b.apply(d,c);a=setTimeout(function(){g||b.apply(d,c);a=null},k||100)}};jQuery.fn[g]=function(b){return b?this.bind("resize",h(b)):this.trigger(g)}})(jQuery,"shiftsmartresize");
|
31 |
+
var shift_supports=function(){var b=document.createElement("div"),g=["Khtml","Ms","O","Moz","Webkit"];return function(h){var e=g.length;if(h in b.style)return!0;for(h=h.replace(/^[a-z]/,function(b){return b.toUpperCase()});e--;)if(g[e]+h in b.style)return!0;return!1}}();
|
includes/ShiftNavWalker.class.php
CHANGED
@@ -352,7 +352,12 @@ class ShiftNavWalker extends Walker_Nav_Menu {
|
|
352 |
* @param array $args An array of arguments. @see wp_nav_menu()
|
353 |
*/
|
354 |
function end_el( &$output, $item, $depth = 0, $args = array() ) {
|
355 |
-
$
|
|
|
|
|
|
|
|
|
|
|
356 |
}
|
357 |
|
358 |
|
352 |
* @param array $args An array of arguments. @see wp_nav_menu()
|
353 |
*/
|
354 |
function end_el( &$output, $item, $depth = 0, $args = array() ) {
|
355 |
+
if( $item->object != 'ubermenu-custom' ||
|
356 |
+
$item->type_label != '[UberMenu Menu Segment]' ||
|
357 |
+
shiftnav_op( 'process_uber_segments' , 'general' ) == 'off' ){
|
358 |
+
|
359 |
+
$output .= "</li>";
|
360 |
+
}
|
361 |
}
|
362 |
|
363 |
|
shiftnav-responsive-mobile-menu.php
CHANGED
@@ -6,7 +6,7 @@ Description: An off-canvas mobile menu for WordPress
|
|
6 |
Author: Chris Mavricos, SevenSpark
|
7 |
Author URI: http://sevenspark.com
|
8 |
License: GPLv2
|
9 |
-
Version: 1.5.1.
|
10 |
*/
|
11 |
|
12 |
/* Copyright 2014-2017 Chris Mavricos, SevenSpark */
|
@@ -53,7 +53,7 @@ final class ShiftNav {
|
|
53 |
// Plugin version
|
54 |
|
55 |
if( ! defined( 'SHIFTNAV_VERSION' ) )
|
56 |
-
define( 'SHIFTNAV_VERSION', '1.5.1.
|
57 |
|
58 |
if( ! defined( 'SHIFTNAV_PRO' ) )
|
59 |
define( 'SHIFTNAV_PRO', false );
|
6 |
Author: Chris Mavricos, SevenSpark
|
7 |
Author URI: http://sevenspark.com
|
8 |
License: GPLv2
|
9 |
+
Version: 1.5.1.2
|
10 |
*/
|
11 |
|
12 |
/* Copyright 2014-2017 Chris Mavricos, SevenSpark */
|
53 |
// Plugin version
|
54 |
|
55 |
if( ! defined( 'SHIFTNAV_VERSION' ) )
|
56 |
+
define( 'SHIFTNAV_VERSION', '1.5.1.2' );
|
57 |
|
58 |
if( ! defined( 'SHIFTNAV_PRO' ) )
|
59 |
define( 'SHIFTNAV_PRO', false );
|