From 87e8708fa51863dd6b919dcad27f04cf39215790 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 6 Apr 2017 13:21:07 +0900 Subject: [PATCH 1/2] fix deprecated load event binding method in order to work with modern versions of jQuery --- src/javascripts/jquery.tocify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/javascripts/jquery.tocify.js b/src/javascripts/jquery.tocify.js index f464d95..cce25b9 100644 --- a/src/javascripts/jquery.tocify.js +++ b/src/javascripts/jquery.tocify.js @@ -176,7 +176,7 @@ self._setEventHandlers(); // Binding to the Window load event to make sure the correct scrollTop is calculated - $(window).load(function() { + $(window).on("load", function() { // Sets the active TOC item self._setActiveElement(true); From 80fa9cf0b689dd73148b2f583fe58d4f232218cf Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 6 Apr 2017 13:26:47 +0900 Subject: [PATCH 2/2] update also minified JS --- src/javascripts/jquery.tocify.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/javascripts/jquery.tocify.min.js b/src/javascripts/jquery.tocify.min.js index 0fc0442..66d7c0d 100644 --- a/src/javascripts/jquery.tocify.min.js +++ b/src/javascripts/jquery.tocify.min.js @@ -1,4 +1,4 @@ /*! jquery.tocify - v1.9.0 - 2013-10-01 * http://gregfranko.com/jquery.tocify.js/ * Copyright (c) 2013 Greg Franko; Licensed MIT*/ -(function(e){"use strict";e(window.jQuery,window,document)})(function(e,t,s){"use strict";var i="tocify",o="tocify-focus",n="tocify-hover",a="tocify-hide",l="tocify-header",h="."+l,r="tocify-subheader",d="."+r,c="tocify-item",f="."+c,u="tocify-extend-page",p="."+u;e.widget("toc.tocify",{version:"1.9.0",options:{context:"body",ignoreSelector:null,selectors:"h1, h2, h3",showAndHide:!0,showEffect:"slideDown",showEffectSpeed:"medium",hideEffect:"slideUp",hideEffectSpeed:"medium",smoothScroll:!0,smoothScrollSpeed:"medium",scrollTo:0,showAndHideOnScroll:!0,highlightOnScroll:!0,highlightOffset:40,theme:"bootstrap",extendPage:!0,extendPageOffset:100,history:!0,scrollHistory:!1,hashGenerator:"compact",highlightDefault:!0},_create:function(){var s=this;s.extendPageScroll=!0,s.items=[],s._generateToc(),s._addCSSClasses(),s.webkit=function(){for(var e in t)if(e&&-1!==e.toLowerCase().indexOf("webkit"))return!0;return!1}(),s._setEventHandlers(),e(t).load(function(){s._setActiveElement(!0),e("html, body").promise().done(function(){setTimeout(function(){s.extendPageScroll=!1},0)})})},_generateToc:function(){var t,s,o=this,n=o.options.ignoreSelector;return t=-1!==this.options.selectors.indexOf(",")?e(this.options.context).find(this.options.selectors.replace(/ /g,"").substr(0,this.options.selectors.indexOf(","))):e(this.options.context).find(this.options.selectors.replace(/ /g,"")),t.length?(o.element.addClass(i),t.each(function(t){e(this).is(n)||(s=e("