m.common.js 1007 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. function switchAccount(account, method)
  2. {
  3. if(method == 'dynamic')
  4. {
  5. link = createLink('user', method, 'period=' + period + '&account=' + account);
  6. }
  7. else if(method == 'todo')
  8. {
  9. link = createLink('user', method, 'account=' + account + '&type=' + type);
  10. }
  11. else
  12. {
  13. link = createLink('user', method, 'account=' + account);
  14. }
  15. location.href=link;
  16. }
  17. function fixSubMenu()
  18. {
  19. var winWidth = $(window).width();
  20. var width = 0;
  21. $('#subMenu a').each(function()
  22. {
  23. width += $(this).width();
  24. });
  25. if(width > winWidth)
  26. {
  27. $('#subMenu a.moreSubMenu').removeClass('hidden');
  28. var lastNav = $('#subMenu > a').not('.moreSubMenu').last();
  29. lastNav.addClass('item').css('display', lastNav.css('display'));
  30. $('#moreSubMenu').prepend("<div class='divider no-margin'></div>");
  31. $('#moreSubMenu').prepend(lastNav);
  32. fixSubMenu();
  33. }
  34. }
  35. $(function(){fixSubMenu();});