Merge "Simplify ve.ce.ResizableNode by removing code for 'transition' which is not used anyway"

This commit is contained in:
jenkins-bot 2013-06-30 19:57:42 +00:00 committed by Gerrit Code Review
commit f8d7314636

View file

@ -44,13 +44,6 @@ ve.ce.ResizableNode = function VeCeResizableNode( $resizable ) {
ve.ce.ResizableNode.static = {}; ve.ce.ResizableNode.static = {};
/**
* Animate between sizes.
*
* @type {boolean}
*/
ve.ce.ResizableNode.static.transition = true;
/* Methods */ /* Methods */
/** /**
@ -239,8 +232,7 @@ ve.ce.ResizableNode.prototype.onDocumentMouseMove = function ( e ) {
* @method * @method
*/ */
ve.ce.ResizableNode.prototype.onDocumentMouseUp = function () { ve.ce.ResizableNode.prototype.onDocumentMouseUp = function () {
var transition = this.constructor.static.transition, var offset = this.model.getOffset(),
offset = this.model.getOffset(),
width = this.$resizeHandles.outerWidth(), width = this.$resizeHandles.outerWidth(),
height = this.$resizeHandles.outerHeight(), height = this.$resizeHandles.outerHeight(),
surfaceModel = this.getRoot().getSurface().getModel(), surfaceModel = this.getRoot().getSurface().getModel(),
@ -251,20 +243,8 @@ ve.ce.ResizableNode.prototype.onDocumentMouseUp = function () {
this.$resizeHandles.removeClass( 've-ui-resizableNode-handles-resizing' ); this.$resizeHandles.removeClass( 've-ui-resizableNode-handles-resizing' );
$( this.getElementDocument() ).off( '.ve-ce-resizableNode' ); $( this.getElementDocument() ).off( '.ve-ce-resizableNode' );
this.resizing = false; this.resizing = false;
// Transition image resize
if ( transition ) {
this.$resizable.addClass( 've-ce-resizableNode-transitioning' );
}
this.$resizable.css( { 'width': width, 'height': height } ); this.$resizable.css( { 'width': width, 'height': height } );
// Allow resize to occur before re-rendering
setTimeout( ve.bind( function () {
if ( transition ) {
// Prevent further transitioning
this.$resizable.removeClass( 've-ce-resizableNode-transitioning' );
}
// Apply changes to the model // Apply changes to the model
if ( this.model.getAttribute( 'width' ) !== width ) { if ( this.model.getAttribute( 'width' ) !== width ) {
attrChanges.width = width; attrChanges.width = width;
@ -280,6 +260,4 @@ ve.ce.ResizableNode.prototype.onDocumentMouseUp = function () {
} }
this.emit( 'resize' ); this.emit( 'resize' );
}, this ), transition ? 200 : 0 );
}; };