1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/sources/app/widgets/Groups/groups.js
2016-03-15 16:28:38 +01:00

32 lines
1,005 B
JavaScript

var Groups = {
refresh: function() {
var items = document.querySelectorAll('#groups_widget ul li:not(.subheader)');
var i = 0;
while(i < items.length)
{
items[i].onclick = function(e) {
MovimTpl.scrollPanelTop();
Group_ajaxGetItems(this.dataset.server, this.dataset.node);
Group_ajaxGetMetadata(this.dataset.server, this.dataset.node);
Group_ajaxGetAffiliations(this.dataset.server, this.dataset.node);
Group_ajaxGetSubscriptions(this.dataset.server, this.dataset.node, false);
Groups.reset(items);
movim_add_class(this, 'active');
}
i++;
}
},
reset: function(list) {
for(i = 0; i < list.length; i++) {
movim_remove_class(list[i], 'active');
}
}
}
MovimWebsocket.attach(function() {
Notification.current('groups');
Groups_ajaxHeader();
Groups.refresh();
});