mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Merge "Quick fix: image size property update"
This commit is contained in:
commit
3e4a67cf12
|
@ -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