browse.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. $(document).ready(function()
  2. {
  3. $(document).on('click', '#makeupTable td:not(.idTD,.actionTD)', function()
  4. {
  5. // $.zui.modalTrigger.show({name : 'ajaxModal', url : $(this).parent().data('url'), backdrop : 'static'});
  6. return false;
  7. });
  8. $(document).on('click', '.deleteMakeup', function()
  9. {
  10. if(confirm(lang.confirmDelete))
  11. {
  12. $(this).text(lang.deleting);
  13. $.getJSON($(this).attr('href'), function(data)
  14. {
  15. if(data.result == 'success')
  16. {
  17. if(data.locate) return location.href = data.locate;
  18. return location.reload();
  19. }
  20. else
  21. {
  22. alert(data.message);
  23. if(selecter.parents('#ajaxModal').size()) return $.reloadAjaxModal(1200);
  24. return location.reload();
  25. }
  26. });
  27. }
  28. return false;
  29. });
  30. $(document).on('click', '.reviewPass', function()
  31. {
  32. if(confirm(confirmReview.pass))
  33. {
  34. var selecter = $(this);
  35. $.getJSON(selecter.attr('href'), function(data)
  36. {
  37. if(data.result == 'success')
  38. {
  39. if(data.locate) return location.href = data.locate;
  40. return location.reload();
  41. }
  42. else
  43. {
  44. alert(data.message);
  45. return location.reload();
  46. }
  47. });
  48. }
  49. return false;
  50. });
  51. $('.batchPass').on('click', function()
  52. {
  53. $.setAjaxForm('#batchReviewForm');
  54. $('#batchReviewForm').submit();
  55. });
  56. /* expand active tree. */
  57. $('.tree li.active .hitarea').click();
  58. });