link.ui.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. $(function()
  2. {
  3. $('li.' + type + '>a').trigger('click');
  4. });
  5. window.createStorySortLink = function(col)
  6. {
  7. var sort = col.name + '_asc';
  8. var currentOrderBy = 'id_asc';
  9. if(type == 'story') currentOrderBy = orderBy;
  10. if(sort == currentOrderBy) sort = col.name + '_desc';
  11. return sortLink.replace('{orderBy}', sort).replace('{type}', 'story');
  12. }
  13. window.createBugSortLink = function(col)
  14. {
  15. var sort = col.name + '_asc';
  16. var currentOrderBy = 'id_asc';
  17. if(type == 'bug') currentOrderBy = orderBy;
  18. if(sort == currentOrderBy) sort = col.name + '_desc';
  19. return sortLink.replace('{orderBy}', sort).replace('{type}', 'bug');
  20. }
  21. window.createTaskSortLink = function(col)
  22. {
  23. var sort = col.name + '_asc';
  24. var currentOrderBy = 'id_asc';
  25. if(type == 'task') currentOrderBy = orderBy;
  26. if(sort == currentOrderBy) sort = col.name + '_desc';
  27. return sortLink.replace('{orderBy}', sort).replace('{type}', 'task');
  28. }
  29. window.showLink = function(obj)
  30. {
  31. const $tabContent = $(obj).closest('.tab-pane');
  32. const link = $tabContent.find('.link').data('url');
  33. loadTarget(link, $tabContent.attr('id'));
  34. };
  35. window.onSearchLinks = function(type, result)
  36. {
  37. loadTarget(result.load, type, {partial: true})
  38. return false;
  39. };