Sfoglia il codice sorgente

Internal: PendingActions#isPending was renamed to #hasAny. Closes ckeditor/ckeditor5-core#142.

Piotrek Koszuliński 7 anni fa
parent
commit
02b39eda1c

+ 1 - 1
docs/_snippets/builds/saving-data/autosave.js

@@ -50,7 +50,7 @@ function displayStatus( editor ) {
 	const statusIndicator = document.querySelector( '.snippet-autosave-status' );
 	const console = document.querySelector( '#snippet-autosave-console' );
 
-	pendingActions.on( 'change:isPending', ( evt, propertyName, newValue ) => {
+	pendingActions.on( 'change:hasAny', ( evt, propertyName, newValue ) => {
 		if ( newValue ) {
 			statusIndicator.classList.add( 'busy' );
 			console.classList.remove( 'received' );

+ 3 - 3
docs/_snippets/builds/saving-data/manualsave.js

@@ -62,7 +62,7 @@ function handleSaveButton( editor ) {
 function handleStatusChanges( editor ) {
 	const pendingActions = editor.plugins.get( 'PendingActions' );
 
-	pendingActions.on( 'change:isPending', () => updateStatus( editor ) );
+	pendingActions.on( 'change:hasAny', () => updateStatus( editor ) );
 
 	editor.model.document.on( 'change:data', () => {
 		isDirty = true;
@@ -73,7 +73,7 @@ function handleStatusChanges( editor ) {
 
 function handleBeforeunload( editor ) {
 	window.addEventListener( 'beforeunload', evt => {
-		if ( editor.plugins.get( 'PendingActions' ).isPending ) {
+		if ( editor.plugins.get( 'PendingActions' ).hasAny ) {
 			evt.preventDefault();
 		}
 	} );
@@ -88,7 +88,7 @@ function updateStatus( editor ) {
 		saveButton.classList.remove( 'active' );
 	}
 
-	if ( editor.plugins.get( 'PendingActions' ).isPending ) {
+	if ( editor.plugins.get( 'PendingActions' ).hasAny ) {
 		document.querySelector( '#snippet-manual-save-console' ).classList.remove( 'received' );
 		saveButton.value = 'Saving...';
 		saveButton.classList.add( 'saving' );

+ 4 - 4
docs/builds/guides/integration/saving-data.md

@@ -186,7 +186,7 @@ function displayStatus( editor ) {
 	const pendingActions = editor.plugins.get( 'PendingActions' );
 	const statusIndicator = document.querySelector( '#editor-status' );
 
-	pendingActions.on( 'change:isPending', ( evt, propertyName, newValue ) => {
+	pendingActions.on( 'change:hasAny', ( evt, propertyName, newValue ) => {
 		if ( newValue ) {
 			statusIndicator.classList.add( 'busy' );
 		} else {
@@ -266,7 +266,7 @@ function handleSaveButton( editor ) {
 function handleStatusChanges( editor ) {
 	const pendingActions = editor.plugins.get( 'PendingActions' );
 
-	pendingActions.on( 'change:isPending', () => updateStatus( editor ) );
+	pendingActions.on( 'change:hasAny', () => updateStatus( editor ) );
 
 	editor.model.document.on( 'change:data', () => {
 		isDirty = true;
@@ -279,7 +279,7 @@ function handleBeforeunload( editor ) {
 	const pendingActions = editor.plugins.get( 'PendingActions' );
 
 	window.addEventListener( 'beforeunload', evt => {
-		if ( pendingActions.isPending ) {
+		if ( pendingActions.hasAny ) {
 			evt.returnValue = pendingActions.first.message;
 		}
 	} );
@@ -294,7 +294,7 @@ function updateStatus( editor ) {
 		saveButton.classList.remove( 'active' );
 	}
 
-	if ( editor.plugins.get( 'PendingActions' ).isPending ) {
+	if ( editor.plugins.get( 'PendingActions' ).hasAny ) {
 		saveButton.classList.add( 'saving' );
 	} else {
 		saveButton.classList.remove( 'saving' );