mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
3 lines
1.8 KiB
JavaScript
3 lines
1.8 KiB
JavaScript
define ("core_message/message_drawer_view_contacts",["jquery","core/pubsub","core/str","core_message/message_drawer_events","core_message/message_drawer_view_contacts_section_contacts","core_message/message_drawer_view_contacts_section_requests"],function(a,b,c,d,e,f){var g={ACTION_SHOW_CONTACTS_SECTION:"[data-action=\"show-contacts-section\"]",ACTION_SHOW_REQUESTS_SECTION:"[data-action=\"show-requests-section\"]",CONTACT_REQUEST_COUNT:"[data-region=\"contact-request-count\"]",CONTACTS_SECTION_CONTAINER:"[data-section=\"contacts\"]",REQUESTS_SECTION_CONTAINER:"[data-section=\"requests\"]"},h=function(a){return a.find(g.CONTACTS_SECTION_CONTAINER)},i=function(a){return a.find(g.REQUESTS_SECTION_CONTAINER)},j=function(a){return a.find(g.ACTION_SHOW_CONTACTS_SECTION)},k=function(a){return a.find(g.ACTION_SHOW_REQUESTS_SECTION)},l=function(a){return a.hasClass("active")},m=function(a){return function(){var b=a.find(g.CONTACT_REQUEST_COUNT),c=parseInt(b.text(),10);c=isNaN(c)?0:c-1;if(0>=c){b.addClass("hidden")}else{b.text(c)}}},n=function(a){var c=h(a),g=i(a),l=j(a),n=k(a);l.on("show.bs.tab",function(){e.show(c)});n.on("show.bs.tab",function(){f.show(g)});b.subscribe(d.CONTACT_REQUEST_ACCEPTED,m(a));b.subscribe(d.CONTACT_REQUEST_DECLINED,m(a))};return{show:function show(b,c,d,g,m){d=a(d);if(!d.attr("data-contacts-init")){n(d);d.attr("data-contacts-init",!0)}var o=h(d),p=i(d);if(m){var q=j(d),r=k(d);if("requests"==m){q.removeClass("active");o.removeClass("show active");r.addClass("active");p.addClass("show active")}else{r.removeClass("active");p.removeClass("show active");q.addClass("active");o.addClass("show active")}}if(l(o)){e.show(o)}else{f.show(p)}return a.Deferred().resolve().promise()},description:function description(){return c.get_string("messagedrawerviewcontacts","core_message")}}});
|
|
//# sourceMappingURL=message_drawer_view_contacts.min.js.map
|