You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
879 B

  1. var Menu = {
  2. refresh: function() {
  3. var items = document.querySelectorAll('#menu_widget ul li, #post_widget ul.card li');
  4. var i = 0;
  5. while(i < items.length)
  6. {
  7. if(items[i].id != 'history') {
  8. items[i].onclick = function(e) {
  9. MovimTpl.showPanel();
  10. Post_ajaxGetPost(this.dataset.id);
  11. //Menu_ajaxGetNode(this.dataset.server, this.dataset.node);
  12. Menu.reset(items);
  13. movim_add_class(this, 'active');
  14. }
  15. }
  16. i++;
  17. }
  18. },
  19. reset: function(list) {
  20. for(i = 0; i < list.length; i++) {
  21. movim_remove_class(list[i], 'active');
  22. }
  23. }
  24. }
  25. MovimWebsocket.attach(function() {
  26. Notification_ajaxClear('news');
  27. Menu.refresh();
  28. });