r113542 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113541‎ | r113542 | r113543 >
Date:23:15, 9 March 2012
Author:inez
Status:deferred
Tags:
Comment:
Make ContentObserver pass information about content when emiting change event.
Modified paths:
  • /trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.ContentObserver.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.ContentObserver.js
@@ -38,12 +38,17 @@
3939 };
4040
4141 ve.ce.ContentObserver.prototype.poll = function() {
42 - console.log(this.$node[0]);
4342 var text = ve.ce.Surface.getDOMText2( this.$node[0] );
4443 var hash = ve.ce.Surface.getDOMHash( this.$node[0] );
4544
4645 if ( text !== this.prevText || hash !== this.prevHash ) {
47 - this.emit('change');
 46+ this.emit('change', {
 47+ $node: this.$node,
 48+ prevText: this.prevText,
 49+ text: text,
 50+ prevHash: this.prevHash,
 51+ hash: hash
 52+ } );
4853 this.prevText = text;
4954 this.prevHash = hash;
5055 }

Status & tagging log