|
@@ -245,6 +245,11 @@
|
|
</a>
|
|
</a>
|
|
<?php $sectionInternalName = $section->sectionTemplate->internal_name; ?>
|
|
<?php $sectionInternalName = $section->sectionTemplate->internal_name; ?>
|
|
@include('app/patient/note/_templates-index')
|
|
@include('app/patient/note/_templates-index')
|
|
|
|
+ <a href="#" class="d-none text-danger if-edit ml-auto remove-section-trigger"
|
|
|
|
+ data-uid="{{$section->uid}}"
|
|
|
|
+ title="Remove {{$section->sectionTemplate->title}}">
|
|
|
|
+ <i class="fa fa-times-circle"></i>
|
|
|
|
+ </a>
|
|
</div>
|
|
</div>
|
|
<div class="d-none if-not-edit inset-comment">{!! !empty($section->summary_html) ? $section->summary_html : '-' !!}</div>
|
|
<div class="d-none if-not-edit inset-comment">{!! !empty($section->summary_html) ? $section->summary_html : '-' !!}</div>
|
|
<div class="d-none if-edit">@include('sections/'.$section->sectionTemplate->internal_name.'/form')</div>
|
|
<div class="d-none if-edit">@include('sections/'.$section->sectionTemplate->internal_name.'/form')</div>
|
|
@@ -563,6 +568,33 @@
|
|
return loadTemplateSet($(this));
|
|
return loadTemplateSet($(this));
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ $('.remove-section-trigger').click(function() {
|
|
|
|
+ $.post('/api/section/deactivate', {
|
|
|
|
+ uid: $(this).attr('data-uid'),
|
|
|
|
+ memo: 'Deactivated from note',
|
|
|
|
+ }, function(_data) {
|
|
|
|
+ if(_data) {
|
|
|
|
+ if(_data.success) {
|
|
|
|
+ fastReload();
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ toastr.error(_data.message);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ toastr.error('Unable to remove section!');
|
|
|
|
+ }
|
|
|
|
+ }, 'json');
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ $(document)
|
|
|
|
+ .off('mousedown.enable-edit', '.note-section:not(.edit)')
|
|
|
|
+ .on('mousedown.enable-edit', '.note-section:not(.edit)', function() {
|
|
|
|
+ $(this).find('.edit-trigger').first().click();
|
|
|
|
+ return false;
|
|
|
|
+ });
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function loadTemplateSet(_chooser) {
|
|
function loadTemplateSet(_chooser) {
|