ac0d11f5580e49ae3a5407d657a45a4590a9ea8a
[moodle.git] / admin / tool / dataprivacy / amd / build / expand_contract.min.js
1 define ("tool_dataprivacy/expand_contract",["jquery","core/url","core/str"],function(a,b,c){var d=a("<img alt=\"\" src=\""+b.imageUrl("t/expanded")+"\"/>"),e=a("<img alt=\"\" src=\""+b.imageUrl("t/collapsed")+"\"/>");return{expandCollapse:function expandCollapse(a,b){if(a.hasClass("hide")){a.removeClass("hide");a.addClass("visible");a.attr("aria-expanded",!0);b.find(":header i.fa").removeClass("fa-plus-square");b.find(":header i.fa").addClass("fa-minus-square");b.find(":header img.icon").attr("src",d.attr("src"))}else{a.removeClass("visible");a.addClass("hide");a.attr("aria-expanded",!1);b.find(":header i.fa").removeClass("fa-minus-square");b.find(":header i.fa").addClass("fa-plus-square");b.find(":header img.icon").attr("src",e.attr("src"))}},expandCollapseAll:function expandCollapseAll(b){var f="visible"==b?"hide":"visible",g="visible"==b?!0:!1,h="visible"==b?"fa-plus-square":"fa-minus-square",i="visible"==b?"fa-minus-square":"fa-plus-square",j="visible"==b?d.attr("src"):e.attr("src");a("."+f).each(function(){a(this).removeClass(f);a(this).addClass(b);a(this).attr("aria-expanded",g)});a(".tool_dataprivacy-expand-all").data("visibilityState",f);c.get_string(f,"tool_dataprivacy").then(function(b){a(".tool_dataprivacy-expand-all").html(b)}).catch(Notification.exception);a(":header i.fa").each(function(){a(this).removeClass(h);a(this).addClass(i)});a(":header img.icon").each(function(){a(this).attr("src",j)})}}});
2 //# sourceMappingURL=expand_contract.min.js.map