https://bugzilla.wikimedia.org/show_bug.cgi?id=44446
--- Comment #5 from Krinkle <[email protected]> --- Using the following debug calls: diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js index 859d4f8..cee2505 100644 --- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js @@ -390,6 +390,7 @@ ve.init.mw.ViewPageTarget.prototype.onSaveError = function ( jqXHR, status ) { * @param {string} diffHtml */ ve.init.mw.ViewPageTarget.prototype.onShowChanges = function ( diffHtml ) { + mw.log( 'onShowChanges', 'Invalidate the diff (by calling proxiedOnSurfaceModelTransact) on transact event' ); // Invalidate the diff on next change this.surface.getModel().on( 'transact', this.proxiedOnSurfaceModelTransact ); @@ -562,6 +563,7 @@ ve.init.mw.ViewPageTarget.prototype.onToolbarFeedbackToolClick = function () { * @param {ve.dm.Transaction} tx Processed transaction */ ve.init.mw.ViewPageTarget.prototype.onSurfaceModelTransact = function () { + mw.log( 'onSurfaceModelTransact', 'Clear the diff html' ); // Clear the diff this.$saveDialog .find( '.ve-init-mw-viewPageTarget-saveDialog-slide-review .ve-init-mw-viewPageTarget-saveDialog-viewer' ) @@ -691,6 +693,9 @@ ve.init.mw.ViewPageTarget.prototype.setUpSurface = function ( doc ) { this.surface = new ve.Surface( this, doc, this.surfaceOptions ); this.surface.getContext().hide(); this.$document = this.surface.$.find( '.ve-ce-documentNode' ); + this.surface.getModel().on( 'transact', function () { + mw.log( 've.Surface/Model/on/transact' ); + } ); this.surface.getModel().on( 'transact', this.proxiedOnSurfaceModelTransact ); this.surface.getModel().on( 'history', this.proxiedOnSurfaceModelHistory ); // Transplant the toolbar I've determined that the "transact" event does indeed continue to be emitted. But onSurfaceModelTransact only gets called once. It is not being rebound: # Page load, enter text ve.Surface/Model/on/transact load.php:11256 # Press "Review and save" onSurfaceModelTransact Clear the diff html load.php:11256 # Close dialog # Enter more text ve.Surface/Model/on/transact load.php:11256 ve.Surface/Model/on/transact load.php:11256 # Press "Review and save" # Close dialog # Enter more lots more text (14x) ve.Surface/Model/on/transact load.php:11256 -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
