Skip to content

Instantly share code, notes, and snippets.

@GaryJones
Created October 5, 2018 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GaryJones/74222ff69cf5b1bacadf7b881e7e52f6 to your computer and use it in GitHub Desktop.
Save GaryJones/74222ff69cf5b1bacadf7b881e7e52f6 to your computer and use it in GitHub Desktop.
--- /var/folders/5h/n5kgg5w13h77n1ffpd4hm2800000gn/T/xxXKfj_superfish.js 2018-10-05 10:45:22.000000000 +0100
+++ /Users/gary/Local Sites/genesis/app/public/wp-content/themes/genesis/lib/js/menu/superfish.js 2018-10-05 10:45:23.000000000 +0100
@@ -1,13 +1,13 @@
/*
- * jQuery Superfish Menu Plugin
- * Copyright (c) 2013 Joel Birch
+ * jQuery Superfish Menu Plugin - v1.7.6
+ * Copyright (c) 2015
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
-(function ($, w) {
+;(function ($, w) {
"use strict";
var methods = (function () {
@@ -89,8 +89,13 @@
},
touchHandler = function (e) {
var $this = $(this),
+ o = getOptions($this),
$ul = $this.siblings(e.data.popUpSelector);
+ if (o.onHandleTouch.call($ul) === false) {
+ return this;
+ }
+
if ($ul.length > 0 && $ul.is(':hidden')) {
$this.one('click.superfish', false);
if (e.type === 'MSPointerDown' || e.type === 'pointerdown') {
@@ -153,7 +158,11 @@
speed = 0;
}
o.retainPath = false;
- o.onBeforeHide.call($ul);
+
+ if (o.onBeforeHide.call($ul) === false) {
+ return this;
+ }
+
$ul.stop(true, true).animate(o.animationOut, speed, function () {
var $this = $(this);
o.onHide.call($this);
@@ -169,7 +178,10 @@
var $this = this.addClass(o.hoverClass),
$ul = $this.children(o.popUpSelector);
- o.onBeforeShow.call($ul);
+ if (o.onBeforeShow.call($ul) === false) {
+ return this;
+ }
+
$ul.stop(true, true).animate(o.animation, o.speed, function () {
o.onShow.call($ul);
});
@@ -256,7 +268,8 @@
onBeforeHide: $.noop,
onHide: $.noop,
onIdle: $.noop,
- onDestroy: $.noop
+ onDestroy: $.noop,
+ onHandleTouch: $.noop
};
})(jQuery, window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment