mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 17:36:35 +00:00
Quick fix: image size property update
This is a bit of a workaround for scalable image nodes to update the current size rather than only the original one. This is done so the MediaSizeWidget in the media edit dialog is fed the current dimensions of the image even without the image being saved. Ideally, the node's 'currentDimensions' property should be constantly updated to current dimensions. This workaround fixes the given bug, in which all images show the original wikitext/default size even after being resized. Bug: 61052 Change-Id: I902d1f51b1389f2f9b2b5c871b578ee2244a946f
This commit is contained in:
parent
84f7d9f3b0
commit
80558f85dc
|
@ -307,6 +307,19 @@ ve.ui.MWMediaEditDialog.prototype.setup = function ( data ) {
|
|||
|
||||
this.sizeWidget.setPropertiesFromScalable( mediaNodeView );
|
||||
|
||||
// HACK: Override properties with image-specific current size
|
||||
// Ideally, this should be dealt with in setPropertiesFromScalable
|
||||
// but the currentDimensions object of the mediaNodeView seems
|
||||
// to not be updated properly. Without this hack, the media
|
||||
// dialog presents the dimensions that the image had in the
|
||||
// beginning of the session (in the wikitext) rather than update
|
||||
// these when the image is resized either from the dialog or
|
||||
// by the resize handles.
|
||||
this.sizeWidget.setCurrentDimensions( {
|
||||
'width': this.mediaNode.getAttribute( 'width' ),
|
||||
'height': this.mediaNode.getAttribute( 'height' )
|
||||
} );
|
||||
|
||||
if ( !mediaNodeView.getOriginalDimensions() ) {
|
||||
mediaNodeView.fetchDimensions()
|
||||
.done( function () {
|
||||
|
|
Loading…
Reference in a new issue