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.

34 lines
977 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. if(this.dataset.id) {
  10. MovimTpl.showPanel();
  11. Post_ajaxGetPost(this.dataset.id);
  12. //Menu_ajaxGetNode(this.dataset.server, this.dataset.node);
  13. Menu.reset(items);
  14. movim_add_class(this, 'active');
  15. }
  16. }
  17. }
  18. i++;
  19. }
  20. },
  21. reset: function(list) {
  22. for(i = 0; i < list.length; i++) {
  23. movim_remove_class(list[i], 'active');
  24. }
  25. }
  26. }
  27. MovimWebsocket.attach(function() {
  28. Notification_ajaxClear('news');
  29. Notification.current('news');
  30. Menu.refresh();
  31. });