Просмотр исходного кода

fix: hide modals when pressing Esc, fixes #8988 (#8994)

Jesse White 8 лет назад
Родитель
Сommit
f547c93a4f
1 измененных файлов с 1 добавлено и 5 удалено
  1. 1 5
      public/app/core/services/keybindingSrv.ts

+ 1 - 5
public/app/core/services/keybindingSrv.ts

@@ -214,12 +214,8 @@ export class KeybindingSrv {
       if (popups.length > 0) {
         return;
       }
-      // close modals
-      var modalData = $(".modal").data();
-      if (modalData && modalData.$scope && modalData.$scope.dismiss) {
-        modalData.$scope.dismiss();
-      }
 
+      scope.appEvent('hide-modal');
       scope.appEvent('hide-dash-editor');
       scope.appEvent('panel-change-view', {fullscreen: false, edit: false});
     });