Mooeypoo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/183303

Change subject: Check staged changes in surface hasBeenModified
......................................................................

Check staged changes in surface hasBeenModified

Make sure that hasBeenModified check also looks into staged actions.
This will also fix the case where inspectors are applied to surfaces
like image caption where the dialog should set its 'apply' button
based on whether the surface changed or not.

Bug: T85845
Change-Id: Iebb55959b5b24eec29a00015edc948c32f9fdba5
---
M src/dm/ve.dm.Surface.js
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/03/183303/1

diff --git a/src/dm/ve.dm.Surface.js b/src/dm/ve.dm.Surface.js
index 040d962..8e79a99 100644
--- a/src/dm/ve.dm.Surface.js
+++ b/src/dm/ve.dm.Surface.js
@@ -409,7 +409,11 @@
  * @returns {boolean} The surface has been modified
  */
 ve.dm.Surface.prototype.hasBeenModified = function () {
-       return this.undoStack.length - this.undoIndex > 0 || 
!!this.newTransactions.length;
+       return (
+               this.isStaging() ||
+               this.undoStack.length - this.undoIndex > 0 ||
+               !!this.newTransactions.length
+       );
 };
 
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/183303
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iebb55959b5b24eec29a00015edc948c32f9fdba5
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <mor...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to