mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Refactor renderContents() deduplication code
Change-Id: Ib8672b51fc236cac805b88a99d07b3c496548cbd
This commit is contained in:
parent
f00da336a5
commit
f21a385bd9
|
@ -32,10 +32,13 @@ ve.ce.ContentBranchNode = function VeCeContentBranchNode( model, $element ) {
|
|||
// have in mind that this transaction here is not being used in any other way than just as
|
||||
// a flag to figure out if renderContents should be executed or not.
|
||||
this.on( 'childUpdate', ve.bind( function( transaction ) {
|
||||
if ( !lastTransaction || lastTransaction !== transaction ) {
|
||||
if ( transaction instanceof ve.dm.Transaction ) {
|
||||
if ( lastTransaction === transaction ) {
|
||||
return;
|
||||
}
|
||||
lastTransaction = transaction;
|
||||
this.renderContents();
|
||||
}
|
||||
this.renderContents();
|
||||
}, this ) );
|
||||
|
||||
// Initialization
|
||||
|
|
Loading…
Reference in a new issue