mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge "Create and process transaction only if the value of given attribute (width or height) really changed"
This commit is contained in:
commit
dc37f3132e
|
@ -215,9 +215,15 @@ ve.ce.ResizableNode.prototype.onDocumentMouseUp = function () {
|
|||
$( document ).off( '.ve-ce-resizableNode' );
|
||||
this.resizing = false;
|
||||
|
||||
txs.push( ve.dm.Transaction.newFromAttributeChange( documentModel, offset, 'width', width ) );
|
||||
txs.push( ve.dm.Transaction.newFromAttributeChange( documentModel, offset, 'height', height ) );
|
||||
surfaceModel.change( txs, selection );
|
||||
if ( this.model.getAttribute( 'width' ) !== width ) {
|
||||
txs.push( ve.dm.Transaction.newFromAttributeChange( documentModel, offset, 'width', width ) );
|
||||
}
|
||||
if ( this.model.getAttribute( 'height' ) !== height ) {
|
||||
txs.push( ve.dm.Transaction.newFromAttributeChange( documentModel, offset, 'height', height ) );
|
||||
}
|
||||
if ( txs.length > 0 ) {
|
||||
surfaceModel.change( txs, selection );
|
||||
}
|
||||
|
||||
// HACK: Update bounding box
|
||||
this.onResizableFocus();
|
||||
|
|
Loading…
Reference in a new issue