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

33 lines
1,005 B
JavaScript
Raw Normal View History

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);
2015-09-10 15:41:45 +02:00
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();
});