Selaa lähdekoodia

Collapse active segment on ESC

Vijayakrishnan 3 vuotta sitten
vanhempi
commit
44d65f3280
1 muutettua tiedostoa jossa 14 lisäystä ja 6 poistoa
  1. 14 6
      resources/views/app/patient/note/dashboard_script.blade.php

+ 14 - 6
resources/views/app/patient/note/dashboard_script.blade.php

@@ -350,12 +350,20 @@
                     });
                 @endif
 
-                // $(document)
-                //     .off('mousedown.enable-edit', '.note-section:not(.edit).page-driven')
-                //     .on('mousedown.enable-edit', '.note-section:not(.edit).page-driven', function(e) {
-                //         alert('booya');
-                //         return false;
-                //     });
+                $(document)
+                    .off('keydown.collapse-active-segment')
+                    .on('keydown.collapse-active-segment', function(e) {
+                        if(e.which === 27) {
+                            if(!isEventConsumed(e)) {
+                                $('.visit-segment.edit').first().find('.edit-trigger').first().click();
+                                markEventAsConsumed(e);
+                                return false;
+                            }
+                            else {
+                                // event already consumed!
+                            }
+                        }
+                    });
 
                 scrollToLatest();