Merge "Create and process transaction only if the value of given attribute (width or height) really changed"

This commit is contained in:
jenkins-bot 2013-04-25 00:27:04 +00:00 committed by Gerrit Code Review
commit dc37f3132e

View file

@ -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();