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

Tests: Added onbeforeunload handlet to PandingActions manual test.

Oskar Wróbel 7 лет назад
Родитель
Сommit
51f2173d98
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      packages/ckeditor5-core/tests/manual/pendingactions.js

+ 6 - 0
packages/ckeditor5-core/tests/manual/pendingactions.js

@@ -43,6 +43,12 @@ ClassicEditor
 				.then( () => pendingActions.remove( action ) );
 		} );
 
+		window.addEventListener( 'beforeunload', evt => {
+			if ( pendingActions.isPending ) {
+				evt.returnValue = pendingActions.first.message;
+			}
+		} );
+
 		pendingActions.on( 'add', () => displayActions() );
 		pendingActions.on( 'remove', () => displayActions() );