memo.blade.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!--- memo --->
  2. <div class="modal fade" id="modal-memo" aria-hidden="true" data-backdrop="static" style="z-index: 1050; overflow: auto;">
  3. <div class="modal-dialog m-auto pt-4">
  4. <div class="modal-content">
  5. <div class="modal-header bg-slate-300">
  6. <h4 class="modal-title text-white" id="myModalLabel">메모필드 입력 -메모필드(여러줄로 입력될 수 있는 필드)</h4>
  7. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fas fa-times"></i></button>
  8. </div>
  9. <div class="modal-body p-2" style="background-color: #f5f5f5;">
  10. <div class="mt-4">
  11. @include('components.web-editor')
  12. <textarea id="memo-editor" style="height: 690px; display: none;"></textarea>
  13. </div>
  14. <div class="position-absolute" style="top: 3px; right: 10px;">
  15. <button type="button" class="font-weight-bold btn btn-secondary"
  16. onclick="change_memo_mode(this)">
  17. 모드 Toggle
  18. </button>
  19. <button type="button" class="font-weight-bold btn btn-danger btn-sm icon-copy3 complete-memo-btn"
  20. onclick="complete_memo(this)">
  21. </button>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. @once
  28. <script src="{{ csset('/js/components/web-editor.js') }}"></script>
  29. <script>
  30. $('#modal-memo').on('show.bs.modal', function (event) {
  31. $(this).find('#froala-editor').show()
  32. $(this).find('#memo-editor').hide()
  33. $(this).find('#memo-editor').val('')
  34. })
  35. $('#modal-memo').on('hide.bs.modal', function (event) {
  36. const editor = $(this).find('#froala-editor')[0]['data-froala.editor']
  37. if (editor.codeView.isActive()) {
  38. editor.codeView.toggle()
  39. }
  40. })
  41. $(document).ready(async function() {
  42. let para_path = @json($paraPath ?? '');
  43. if (para_path) {
  44. mediaModal = await include_media_library('media-body', 'post', para_path)
  45. } else {
  46. mediaModal = await include_media_library('media-body', 'post')
  47. }
  48. });
  49. let mediaModal;
  50. </script>
  51. @endonce