common.js 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. jQuery(function($){
  2. //화면사이즈에 따라 컨트롤 resize
  3. $(window).on('load resize',function(){
  4. wh=$(window).height();
  5. var max=(wh-115);
  6. $('body').height(max);
  7. $('#page').height(max);
  8. $('#maincontent').height(max);
  9. $('.tabDepth1>.tab-content').height(max-40);
  10. $('.patientList').height(max-245);
  11. var basic=$('.tabDepth1>.tab-content').height();
  12. $('.fat-ov-container.patient-info-1').height((basic/2)-100);
  13. $('.fat-ov-container.patient-info-2').height((basic/2)-60);
  14. if($('#sidebar a.active').length>0){
  15. if($('#sidebar a.active')[0].id=='menuOutpatient'){
  16. $('.fat-ov-container.fat-ov-container-1').height(basic-355);
  17. }else{
  18. $('.fat-ov-container.fat-ov-container-1').height(basic-300);
  19. };
  20. };
  21. $('.fat-ov-container.fat-ov-container-2').height(basic-60);
  22. $('.fat-ov-container.fat-ov-container-3').height(basic-155);
  23. $('#consentImgBox').height(max);
  24. });
  25. //버튼그룹, 현재 환자별/ 주치의별에 사용중
  26. $(".btn-group button").click(function(){
  27. $(".btn-group button").removeClass('active')
  28. $(this).addClass('active')
  29. });
  30. //동의서검색 체크박스 제어
  31. $('.consentSearchBox input[type=checkbox]').on('change', function(e){
  32. if(e.currentTarget.value=='ALL'&&e.currentTarget.checked==true){
  33. $('.consentSearchBox input[type=checkbox][value="ALL"]').prop("checked", true);
  34. $('.consentSearchBox input[type=checkbox][value!="ALL"]:checked').prop("checked", false);
  35. }else if(e.currentTarget.value!='ALL'&&e.currentTarget.checked==true){
  36. if($('.consentSearchBox input[type=checkbox][value!="ALL"]:checked').length==$('.consentSearchBox input[type=checkbox]').length-1){
  37. $('.consentSearchBox input[type=checkbox][value="ALL"]').prop("checked", true);
  38. $('.consentSearchBox input[type=checkbox][value!="ALL"]:checked').prop("checked", false);
  39. }else if($('.consentSearchBox input[type=checkbox][value="ALL"]').prop("checked")){
  40. $('.consentSearchBox input[type=checkbox][value="ALL"]').prop("checked", false);
  41. }
  42. }else if(e.currentTarget.value!='ALL'&&e.currentTarget.checked==false){
  43. $('.consentSearchBox input[type=checkbox][value="ALL"]').prop("checked", false);
  44. }
  45. });
  46. //동의서삭제 사유 선택란 textarea readonly제어
  47. $('#mplusConsentDeleteForm input[name=consentDeleteRadio]').on('change', function(e){
  48. if(e.currentTarget.value=="slt4"){
  49. $('#consentDeleteTextarea').removeAttr("readonly");
  50. }else{
  51. $('#consentDeleteTextarea').attr("readonly", "true");
  52. }
  53. });
  54. //동의서 삭제사유 선택 모달 닫힐때 초기화
  55. $('#mplusConsentDeleteForm').on('hidden.bs.modal', function () {
  56. $('#mplusConsentDeleteForm input[name=consentDeleteRadio][value="slt1"]').click();
  57. $('#consentDeleteTextarea').val("");
  58. });
  59. // 동의서이미지 조회 모달 열릴떄 스크롤 제일 위로 이동
  60. $('#mplusConsentImageForm').on('shown.bs.modal', function (e) {
  61. $('#consentImgBox').scrollTop(0);
  62. })
  63. });