diff --git a/changelog.md b/changelog.md index 29c6e19..87e9d5f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,13 @@ + +1.4.2 mod +--- +* Jquery 3.x fixes: [shorthand-deprecated-v3] JQMIGRATE: jQuery.fn.click() event shorthand is deprecated and [pre-on-methods] JQMIGRATE: jQuery.fn.unbind() is deprecated + +1.4.2 +--- +TODO + + 1.4.1 ----- * Fix for #2360 diff --git a/jquery.treeview.js b/jquery.treeview.js index 27cee3f..898fe34 100644 --- a/jquery.treeview.js +++ b/jquery.treeview.js @@ -23,11 +23,11 @@ }, hoverClass: function(className) { className = className || "hover"; - return this.hover(function() { - $(this).addClass(className); - }, function() { - $(this).removeClass(className); - }); + return this.on("mouseenter", function () { + $(this).addClass(className); + }).on("mouseleave", function () { + $(this).removeClass(className); + }); }, heightToggle: function(animated, callback) { animated ? @@ -59,7 +59,7 @@ }, applyClasses: function(settings, toggler) { // TODO use event delegation - this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview", function(event) { + this.filter(":has(>ul):not(:has(>a))").find(">span").off("click.treeview").on("click.treeview", function(event) { // don't handle click events on children, eg. checkboxes if ( this == event.target ) toggler.apply($(this).next()); @@ -86,11 +86,11 @@ classes += this + "-hitarea "; }); $(this).addClass( classes ); - }) + }); } // apply event to hitarea - this.find("div." + CLASSES.hitarea).click( toggler ); + this.find("div." + CLASSES.hitarea).on("click", toggler ); }, treeview: function(settings) {