The default modal size is okey for the base providers, but might not be for other providers and for the plupload integration.
The size should be possible to set in the dnd settings.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nagy.balint’s picture

Patch attached, that adds two textfields to the dnd settings to set the ctools modal window's size.

Haza’s picture

We should validate for numeric only values there.

Patch that add that attached.

jcisio’s picture

Status: Needs review » Needs work

CTools modal can take values in both 'px' and '%' units.

Haza’s picture

+    '#description' => t('The height of the modal window opened from the library in pixels.'),

Well, we tell the user we want pixel.

Should we change that to accept % also, and thus change the validate function or we do we only want to allow pixels ?

jcisio’s picture

I think we should change the validate function to accept both % and pixel (and check both width/have use the same unit). In case the size is in '%', we need to change type => 'fixed' to type => 'scale', too.

nagy.balint’s picture

Status: Needs work » Needs review
FileSize
3.04 KB

I extended the patch.

Now if number is between 0 and 1 (like 0.5, 0.7 etc) then it will assume that its a percentage value (as any pixel value below like 200 will not work anyways), and if the number is above 1 then it assumes it is a pixel value.

It will also make sure negative numbers cannot be entered. Because of the percentage value, i convert the input to (float), so it is good for both cases.

jcisio’s picture

Status: Needs review » Fixed

Thanks. Committed #6 with a spelling fix.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.