Explorar el Código

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 hace 8 años
padre
commit
3ea63a1064
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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) => {