Fix border checkbox

Make sure border is enabled for unframed types and disabled for
framed images.

Change-Id: I716e9bc4140fbc09aac52930d1dd8213f31617a3
This commit is contained in:
Moriel Schottlender 2014-04-16 00:03:35 -04:00
parent 24071290a8
commit 8d99aa88c8

View file

@ -363,12 +363,19 @@ ve.ui.MWMediaEditDialog.prototype.onTypeChange = function ( item ) {
// enforce any max size
this.scalable.setEnforcedMax( false );
}
} else {
// Don't limit maximum dimensions on basic and frameless images
this.scalable.setEnforcedMax( false );
}
// Disable border checkbox for framed images
// According to documentation:
// https://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax#Border
if ( selectedType === 'frame' ) {
// Disable border option
this.borderCheckbox.setDisabled( true );
this.borderCheckbox.setValue( false );
} else {
// Don't limit maximum dimensions on basic and frameless images
this.scalable.setEnforcedMax( false );
// Enable border option
this.borderCheckbox.setDisabled( false );
}