PluginProbe
School Management System – WPSchoolPress / 2.2.38
School Management System – WPSchoolPress v2.2.38
2.2.48 2.2.47 2.2.46 2.2.45 2.2.44 2.2.43 2.2.42 2.2.41 2.2.40 2.2.39 2.2.38 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 All 103 releases
wpschoolpress / js / wpsp-settingtab.js

wpsp-settingtab.js in School Management System – WPSchoolPress 2.2.38, at js/wpsp-settingtab.js

62 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 ! function(s) {
2 s.fn.extend({
3 easyResponsiveTabs: function(a) {
4 var t = a = s.extend({
5 type: "default",
6 width: "auto",
7 fit: !0,
8 closed: !1,
9 activate: function() {}
10 }, a),
11 e = t.type,
12 i = t.fit,
13 p = t.width,
14 r = "vertical",
15 n = "accordion";
16 s(this).bind("tabactivate", function(s, t) {
17 "function" == typeof a.activate && a.activate.call(t, s)
18 }), this.each(function() {
19 var t, c = s(this),
20 o = c.find("ul.wpsp-resp-tabs-list");
21 c.find("ul.wpsp-resp-tabs-list li").addClass("wpsp-resp-tab-item"), c.css({
22 display: "block",
23 width: p
24 }), c.find(".wpsp-resp-tabs-container > div").addClass("wpsp-resp-tab-content"),
25 function() {
26 e == r && c.addClass("resp-vtabs");
27 1 == i && c.css({
28 width: "100%",
29 margin: "0px"
30 });
31 e == n && (c.addClass("resp-easy-accordion"), c.find(".wpsp-resp-tabs-list").css("display", "none"))
32 }(), c.find(".wpsp-resp-tab-content").before("<h2 class='resp-accordion' role='tab'><span class='resp-arrow'></span></h2>");
33 var d = 0;
34 c.find(".resp-accordion").each(function() {
35 t = s(this);
36 var a = c.find(".wpsp-resp-tab-item:eq(" + d + ")").html();
37 c.find(".resp-accordion:eq(" + d + ")").append(a), t.attr("aria-controls", "tab_item-" + d), d++
38 });
39 var l = 0;
40 c.find(".wpsp-resp-tab-item").each(function() {
41 $tabItem = s(this), $tabItem.attr("aria-controls", "tab_item-" + l), $tabItem.attr("role", "tab"), !0 === a.closed || "accordion" === a.closed && !o.is(":visible") || "tabs" === a.closed && o.is(":visible") || (c.find(".wpsp-resp-tab-item").first().addClass("wpsp-resp-tab-active"), c.find(".resp-accordion").first().addClass("wpsp-resp-tab-active"), c.find(".wpsp-resp-tab-content").first().addClass("wpsp-resp-tab-content-active").attr("style", "display:block"));
42 var t = 0;
43 c.find(".wpsp-resp-tab-content").each(function() {
44 s(this).attr("aria-labelledby", "tab_item-" + t), t++
45 }), l++
46 }), c.find("[role=tab]").each(function() {
47 var a = s(this);
48 a.click(function() {
49 var t = a.attr("aria-controls");
50 if (a.hasClass("resp-accordion") && a.hasClass("wpsp-resp-tab-active")) return c.find(".wpsp-resp-tab-content-active").slideUp("", function() {
51 s(this).addClass("resp-accordion-closed")
52 }), a.removeClass("wpsp-resp-tab-active"), s(".wpsp-resp-tab-active").removeClass("wpsp-resp-tab-active"), !1;
53 !a.hasClass("wpsp-resp-tab-active") && a.hasClass("resp-accordion") ? (c.find(".wpsp-resp-tab-active").removeClass("wpsp-resp-tab-active"), c.find(".wpsp-resp-tab-active").removeClass("wpsp-resp-tab-active"), c.find(".wpsp-resp-tab-content-active").slideUp().removeClass("wpsp-resp-tab-content-active resp-accordion-closed"), c.find("[aria-controls=" + t + "]").addClass("wpsp-resp-tab-active"), c.find(".wpsp-resp-tab-content[aria-labelledby = " + t + "]").slideDown().addClass("wpsp-resp-tab-content-active")) : (c.find(".wpsp-resp-tab-active").removeClass("wpsp-resp-tab-active"), c.find(".wpsp-resp-tab-content-active").removeAttr("style").removeClass("wpsp-resp-tab-content-active").removeClass("resp-accordion-closed"), c.find("[aria-controls=" + t + "]").addClass("wpsp-resp-tab-active"), c.find(".wpsp-resp-tab-content[aria-labelledby = " + t + "]").addClass("wpsp-resp-tab-content-active").attr("style", "display:block")), a.trigger("tabactivate", a)
54 }), s(window).resize(function() {
55 c.find(".resp-accordion-closed").removeAttr("style")
56 })
57 })
58 })
59 }
60 })
61 }(jQuery);
62