Mooeypoo has uploaded a new change for review.

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

Change subject: SurfaceWidgets should listen to history
......................................................................

SurfaceWidgets should listen to history

The history event reflects actual changes, rather than the transact
event that masks staged changes done to the document.

Bug: T85845
Change-Id: I1faeb97677540f08c512b48b47fafe28b1072579
---
M modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
M modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
2 files changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/09/184409/1

diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
index 7b96970..21c92b8 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js
@@ -850,8 +850,8 @@
 
        // Events
 
-       this.captionSurface.getSurface().getModel().getDocument().connect( 
this, {
-               transact: this.checkChanged.bind( this )
+       this.captionSurface.getSurface().getModel().connect( this, {
+               history: this.checkChanged.bind( this )
        } );
 };
 
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
index c6d85d7..ed3942d 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWReferenceDialog.js
@@ -159,7 +159,7 @@
 /**
  * Handle reference surface change events
  */
-ve.ui.MWReferenceDialog.prototype.onDocumentTransact = function () {
+ve.ui.MWReferenceDialog.prototype.onSurfaceWidgetHistory = function () {
        var hasContent = this.documentHasContent();
 
        this.actions.setAbilities( {
@@ -254,7 +254,9 @@
        );
 
        // Events
-       this.referenceModel.getDocument().connect( this, { transact: 
'onDocumentTransact' } );
+       this.referenceSurface.getSurface().getModel().connect( this, {
+               history: this.onSurfaceWidgetHistory.bind( this )
+       } );
 
        // Initialization
        this.originalGroup = this.referenceModel.getGroup();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1faeb97677540f08c512b48b47fafe28b1072579
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/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