setup.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. $('.select').select2({
  2. minimumResultsForSearch: Infinity,
  3. });
  4. $('.toggle-full-screen').click(function () {
  5. $(this).children().toggleClass('fa-expand-arrows-alt fa-compress-arrows-alt')
  6. if (!document.fullscreenElement) {
  7. document.documentElement.requestFullscreen();
  8. } else {
  9. if (document.exitFullscreen) {
  10. document.exitFullscreen();
  11. }
  12. }
  13. });
  14. $('[data-toggle="tooltip"]').tooltip()
  15. $(document).on('show.bs.modal', '.modal', function (event) {
  16. $('.modal').draggable({ handle: ".modal-header" });
  17. })
  18. $(document).on('keydown','.decimal', function (event) {
  19. handleEnterPressedinNormalCell(event, function() {})
  20. }).on('focusout','.decimal', function () {
  21. $(this).val(format_conver_for(minusComma($(this).val()), $(this).data('point')))
  22. });
  23. // 전체 input 텍스트박스 더블클릭 시 초기화
  24. $(document).on('dblclick', 'input[type="text"]:enabled.filter', function () {
  25. $(this).val('')
  26. })
  27. $(document).on('mouseenter', '.table-row > tbody > tr > td, .table-row > thead th', function () {
  28. let $this = $(this);
  29. if (this.offsetWidth < this.scrollWidth && !$this.attr('title')) {
  30. $this.tooltip({
  31. title: $this.text(),
  32. animated: 'fade',
  33. placement: 'right',
  34. container: 'body',
  35. // trigger: 'click'
  36. });
  37. $this.tooltip('show');
  38. }
  39. }).on('mouseleave', '.table-row > tbody > tr > td, .table-row > thead th', function() {
  40. $('.tooltip').hide();
  41. $('.tooltip').tooltip('dispose');
  42. // $('.tooltip').tooltip('hide');
  43. });
  44. $(document).on('mouseenter', ".table-row > tbody > tr > td img", function () {
  45. $(this).tooltip({
  46. html: true,
  47. title: `<img src="${$(this).attr('src')}" onerror="this.src='/images/folder.jpg'"/>`,
  48. animated: 'fade',
  49. placement: 'right',
  50. container: 'body',
  51. // trigger: 'click'
  52. });
  53. $(this).tooltip('show');
  54. }).on('mouseleave', '.table-row > tbody > tr > td img', function() {
  55. $('.tooltip').hide();
  56. $('.tooltip').tooltip('dispose');
  57. });
  58. $(document).on('mouseenter', ".tooltip-show-img", function () {
  59. if ($(this).val()) {
  60. $(this).tooltip('dispose')
  61. $(this).tooltip({
  62. html: true,
  63. title: `<img src="${window.env['MEDIA_URL'] + $(this).val()}" onerror="this.src='/images/folder.jpg'"/>`,
  64. animated: 'fade',
  65. placement: 'bottom',
  66. container: 'body',
  67. // trigger: 'click'
  68. });
  69. $(this).tooltip('show');
  70. }
  71. }).on('mouseleave', '.tooltip-show-img', function() {
  72. $('.tooltip').hide();
  73. $('.tooltip').tooltip('dispose');
  74. });
  75. $(document).on('mouseenter', 'table .txt_box', function () {
  76. let $this = $(this);
  77. if (! $this.data('title')) { return; }
  78. $this.tooltip({
  79. title: $this.data('title'),
  80. animated: 'fade',
  81. placement: 'top',
  82. container: 'body',
  83. });
  84. $this.tooltip('show');
  85. }).on('mouseleave', '.table .txt_box', function() {
  86. $('.tooltip').hide();
  87. $('.tooltip').tooltip('dispose');
  88. });