Skip to content

Commit 83801c6

Browse files
jenkins-botGerrit Code Review
authored andcommitted
Merge "Allow document state metadata to be stored without clearing HTML"
2 parents 3850486 + fd61405 commit 83801c6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/dm/ve.dm.Surface.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ ve.dm.Surface.prototype.storeDocState = function ( state, html ) {
13641364
// Clear any changes that may have stored up to this point
13651365
this.removeDocStateAndChanges();
13661366
if ( state ) {
1367-
if ( !ve.init.platform.setSession( 've-docstate', JSON.stringify( state ) ) ) {
1367+
if ( !this.updateDocState( state ) ) {
13681368
this.stopStoringChanges();
13691369
return false;
13701370
}
@@ -1386,6 +1386,16 @@ ve.dm.Surface.prototype.storeDocState = function ( state, html ) {
13861386
return true;
13871387
};
13881388

1389+
/**
1390+
* Update stored document state metadata, without changing the HTML
1391+
*
1392+
* @param {Object} state Document state
1393+
* @return {boolean} Document metadata was successfully stored
1394+
*/
1395+
ve.dm.Surface.prototype.updateDocState = function ( state ) {
1396+
return ve.init.platform.setSession( 've-docstate', JSON.stringify( state ) );
1397+
};
1398+
13891399
/**
13901400
* Remove the auto-saved document state and stashed changes
13911401
*/

0 commit comments

Comments
 (0)