|
@@ -232,7 +232,7 @@ for ($i = 0; $i < count($fields); $i++) {
|
|
|
<input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
@endif
|
|
|
<input type="hidden" name="category" value="ROS">
|
|
|
- <input type="hidden" name="data">
|
|
|
+ <input type="hidden" name="data" value='{!! json_encode($contentData) !!}'>
|
|
|
|
|
|
<div id="edit-ros-container">
|
|
|
<div class="d-flex align-items-center mb-3">
|
|
@@ -300,11 +300,8 @@ for ($i = 0; $i < count($fields); $i++) {
|
|
|
<div class="mb-2">
|
|
|
<textarea class="form-control form-control-sm" v-model="comments">{!! $parsed && @$parsed->content ? @$parsed->content : '' !!}</textarea>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- @if(!!$segment)
|
|
|
- <div class="my-2">
|
|
|
- <button submit class="btn btn-sm btn-primary mr-2"><i class="fa fa-save"></i></button>
|
|
|
+ <div class="mt-3">
|
|
|
+ <button type="button" class="btn btn-sm btn-primary mr-2" v-on:click.prevent="saveROS()">Save</button>
|
|
|
<div class="d-inline-flex align-self-stretch align-items-center">
|
|
|
<span class="autosave-indicator saving text-sm text-secondary">Saving changes …</span>
|
|
|
<span class="autosave-indicator saved text-sm text-secondary">
|
|
@@ -313,12 +310,7 @@ for ($i = 0; $i < count($fields); $i++) {
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- @else
|
|
|
- <div class="my-2">
|
|
|
- <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
|
|
|
- <button cancel class="btn btn-sm btn-default border" {!! @$closeOnSave ? 'onmousedown="return closeStagPopup()"' : '' !!}>Close</button>
|
|
|
- </div>
|
|
|
- @endif
|
|
|
+ </div>
|
|
|
|
|
|
</form>
|
|
|
</div>
|
|
@@ -326,7 +318,7 @@ for ($i = 0; $i < count($fields); $i++) {
|
|
|
<script>
|
|
|
(function() {
|
|
|
|
|
|
- window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = function() {
|
|
|
+ function initROS() {
|
|
|
|
|
|
let model = <?= $contentData ? json_encode($contentData) : '{}' ?>;
|
|
|
|
|
@@ -355,11 +347,18 @@ for ($i = 0; $i < count($fields); $i++) {
|
|
|
Vue.nextTick(function() {
|
|
|
$('#edit-ros-container').find('textarea').first().trigger('input');
|
|
|
});
|
|
|
+ },
|
|
|
+ saveROS: function() {
|
|
|
+ saveVisitForm($('#edit-ros-container')[0], false, true);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- };
|
|
|
+ }
|
|
|
+
|
|
|
+ // window.segmentInitializers.<?= !!@$segment ? $segment->segmentTemplate->internal_name : $segmentInternalName ?> = initROS;
|
|
|
+
|
|
|
+ addMCInitializer('init-ros-{{$note->id}}', initROS, '#edit-ros-container');
|
|
|
|
|
|
}).call(window);
|
|
|
</script>
|