Forráskód Böngészése

[use-shortcuts] support multiple shortcut sets "hpi,user" for ex.

Vijayakrishnan 3 éve
szülő
commit
a503261458

+ 1 - 1
config/app.php

@@ -65,7 +65,7 @@ return [
 
     'hrm2_url' => env('HRM2_URL'),
 
-    'asset_version' => 28,
+    'asset_version' => 29,
 
     'temp_dir' => env('TEMP_DIR'),
 

+ 5 - 4
public/js/shortcut.js

@@ -125,10 +125,11 @@
                     case 64:
                         backtrackAfterApplying = true;
                         strPart = '@';
-                        let options = window.userShortcuts, noteRTE = $(input).closest('[note-rte]');
-                        if(noteRTE.length && noteRTE.is('[use-shortcuts]') && noteRTE.attr('use-shortcuts') && noteRTE.attr('use-shortcuts') !== 'user') {
-                            if(window[noteRTE.attr('use-shortcuts') + 'Shortcuts']) {
-                                options = window[noteRTE.attr('use-shortcuts') + 'Shortcuts'];
+                        let options = [], noteRTE = $(input).closest('[note-rte]');
+                        let scSets = noteRTE.attr('use-shortcuts') ? noteRTE.attr('use-shortcuts').split(',') : 'user'
+                        for (let i = 0; i < scSets.length; i++) {
+                            if(window[$.trim(scSets[i]) + 'Shortcuts']) {
+                                options = options.concat(window[$.trim(scSets[i]) + 'Shortcuts']);
                             }
                         }
                         show(true, options);

+ 1 - 1
resources/views/app/patient/segment-templates/_child_review/edit-review.php

@@ -56,7 +56,7 @@ else {
 
         <div class="mb-2">
             <div note-rte
-                 <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi"' : '' ?>
+                 <?= $segment->segmentTemplate->internal_name === 'intake_problems' ? 'use-shortcuts="hpi,user"' : '' ?>
                  class="form-group mb-2 border-left border-right rte-holder"
                  data-field-name="value"><?= $currentValue ?></div>
         </div>