From 8d99aa88c85b0ef7e267c38ebf45c4781aa1d988 Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Wed, 16 Apr 2014 00:03:35 -0400 Subject: [PATCH] Fix border checkbox Make sure border is enabled for unframed types and disabled for framed images. Change-Id: I716e9bc4140fbc09aac52930d1dd8213f31617a3 --- modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js index bde1dd18f1..fadbe717f2 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js @@ -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 ); }