浏览代码

Visit UI - more visit-moe support

Vijayakrishnan 3 年之前
父节点
当前提交
a8a65a47d7

+ 39 - 1
public/css/style.css

@@ -1880,4 +1880,42 @@ table.dashboard-stats-table th {
 }
 .min-height-500px {
     min-height: 500px;
-}
+}
+.strike-through {
+    text-decoration: line-through;
+}
+
+/* visit-moe */
+[visit-moe] [url]:not([show]){
+    display: none;
+}
+[visit-moe] {
+    display: inline-block;
+}
+[visit-moe][relative] {
+    position: relative;
+}
+[visit-moe] [url]:not([show]) {
+    z-index: 99999;
+    position: absolute;
+    background-color: white;
+    padding: 10px;
+    border: 1px solid gray;
+}
+[visit-moe][fixed-center] [url]:not([show]) {
+    position: fixed !important;
+    top: 50% !important;
+    left: 50% !important;
+    width: 600px;
+    transform: translate(-50%, -50%) !important;
+}
+[visit-moe] [url][right] {
+    right: 0;
+    min-width: 200px;
+}
+[visit-moe][large] form, [visit-moe][large] [url] {
+    width: 450px;
+}
+[visit-moe][bottom] form {
+    bottom: 100%;
+}

+ 4 - 2
resources/views/app/patient/note/segment.blade.php

@@ -14,11 +14,13 @@
 		<a class="ml-3 font-weight-normal refresh-segment c-pointer"
 		   data-segment-uid="{{$segment->uid}}"
 		   title="Update with latest patient data">
-			<i class="fa fa-sync"></i>
+			Refresh
 		</a>
 
+		<span class="mx-2 text-secondary text-sm d-none if-edit">|</span>
+
 		<!-- toggle to read mode -->
-		<a class="ml-auto edit-trigger d-none if-edit c-pointer">Close</a>
+		<a class="edit-trigger d-none if-edit c-pointer">Close</a>
 	</div>
 
 	<div class="d-none if-not-edit inset-comment summary-container">

+ 22 - 2
resources/views/app/patient/note/segment_script.blade.php

@@ -16,11 +16,21 @@
                 segment.find('.edit-container').html(_object.editHtml);
                 initRTEs(segment);
                 initSegmentMoes(segment);
-                segment.removeClass('edit');
             }
         }
 
         function initSegmentMoes(_parent) {
+
+            $('body')
+                .off('mousedown.visit-moe-outside-click')
+                .on('mousedown.visit-moe-outside-click', function (e) {
+                    if ($(e.target).closest('[visit-moe]').length) {
+                        return;
+                    }
+                    $('[visit-moe] [url]:not([show])').hide();
+                    return false;
+                });
+
             _parent.find('[visit-moe] [submit]')
                 .off('click.visit-moe-submit')
                 .on('click.visit-moe-submit', function() {
@@ -49,10 +59,20 @@
                     return false;
                 });
 
+            _parent.find('[visit-moe]>a[start]')
+                .off('click.visit-moe-show')
+                .on('click.visit-moe-show', function () {
+                    $(this)
+                        .closest('[visit-moe]')
+                        .find('form[url]')
+                        .show();
+                    return false;
+                });
+
             _parent.find('[visit-moe] [cancel]')
                 .off('click.visit-moe-cancel')
                 .on('click.visit-moe-cancel', function() {
-                    $(this).closest('.note-section').removeClass('edit');
+                    $(this).closest('[visit-moe]').find('[url]:not([show])').hide();
                     return false;
                 });
         }