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

fix for unsaved changes popup on tab close/refresh

Incorrect return values in onbeforeunload event handler mean that the
unsaved changes popup is shown despite there being no changes.
Daniel Lee 8 лет назад
Родитель
Сommit
3ea63a1064
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      public/app/features/dashboard/unsaved_changes_srv.ts

+ 2 - 2
public/app/features/dashboard/unsaved_changes_srv.ts

@@ -35,12 +35,12 @@ export class Tracker {
 
     $window.onbeforeunload = () => {
       if (this.ignoreChanges()) {
-        return '';
+        return null;
       }
       if (this.hasChanges()) {
         return 'There are unsaved changes to this dashboard';
       }
-      return '';
+      return null;
     };
 
     scope.$on('$locationChangeStart', (event, next) => {