From c3bfe323deb74dbacfd9f4a3d05596a407756b67 Mon Sep 17 00:00:00 2001 From: Ali-D-Akbar Date: Tue, 16 Feb 2021 18:09:38 +0500 Subject: [PATCH] PROD-2195 --- lms/static/js/jquery.treeview.js | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/lms/static/js/jquery.treeview.js b/lms/static/js/jquery.treeview.js index 02b452c22a..2d7ad4917b 100755 --- a/lms/static/js/jquery.treeview.js +++ b/lms/static/js/jquery.treeview.js @@ -1,6 +1,6 @@ /* * Treeview 1.5pre - jQuery plugin to hide and show branches of a tree - * + * * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ * http://docs.jquery.com/Plugins/Treeview * @@ -50,7 +50,7 @@ } else { this.hide(); if (callback) - this.each(callback); + this.each(callback); } }, prepareBranches: function(settings) { @@ -70,22 +70,22 @@ if ( this == event.target ) toggler.apply($(this).next()); }).add( $("a", this) ).hoverClass(); - + if (!settings.prerendered) { // handle closed ones first this.filter(":has(>ul:hidden)") .addClass(CLASSES.expandable) .replaceClass(CLASSES.last, CLASSES.lastExpandable); - + // handle open ones this.not(":has(>ul:hidden)") .addClass(CLASSES.collapsable) .replaceClass(CLASSES.last, CLASSES.lastCollapsable); - + // create hitarea if not present var hitarea = this.find("div." + CLASSES.hitarea); if (!hitarea.length) - hitarea = this.prepend("
").find("div." + CLASSES.hitarea); + hitarea = this.prepend("
").find("div." + CLASSES.hitarea); // xss-lint: disable=javascript-jquery-prepend, javascript-concat-html hitarea.removeClass().addClass(CLASSES.hitarea).each(function() { var classes = ""; $.each($(this).parent().attr("class").split(" "), function() { @@ -94,23 +94,23 @@ $(this).addClass( classes ); }) } - + // apply event to hitarea this.find("div." + CLASSES.hitarea).click( toggler ); }, treeview: function(settings) { - + settings = $.extend({ cookieId: "treeview" }, settings); - + if ( settings.toggle ) { var callback = settings.toggle; settings.toggle = function() { return callback.apply($(this).parent()[0], arguments); }; } - + // factory for treecontroller function treeController(tree, control) { // factory for click handlers @@ -130,9 +130,9 @@ // click on second to expand tree $("a:eq(1)", control).click( handler(CLASSES.expandable) ); // click on third to toggle tree - $("a:eq(2)", control).click( handler() ); + $("a:eq(2)", control).click( handler() ); } - + // handle toggle event function toggler() { $(this) @@ -164,7 +164,7 @@ } } this.data("toggler", toggler); - + function serialize() { function binary(arg) { return arg ? 1 : 0; @@ -175,7 +175,7 @@ }); $.cookie(settings.cookieId, data.join(""), settings.cookieOptions ); } - + function deserialize() { var stored = $.cookie(settings.cookieId); if ( stored ) { @@ -185,13 +185,13 @@ }); } } - + // add treeview class to activate styles this.addClass("treeview"); - + // prepare branches and find all tree items with child lists var branches = this.find("li").prepareBranches(settings); - + switch(settings.persist) { case "cookie": var toggleCallback = settings.toggle; @@ -222,19 +222,19 @@ } break; } - + branches.applyClasses(settings, toggler); - + // if control option is set, create the treecontroller and show it if ( settings.control ) { treeController(this, settings.control); $(settings.control).show(); } - + return this; } }); - + // classes used by the plugin // need to be styled via external stylesheet, see first example $.treeview = {}; @@ -252,5 +252,5 @@ last: "last", hitarea: "hitarea" }); - -})(jQuery); \ No newline at end of file + +})(jQuery);