This patch modifies the height of the Ctools modals so our design looks right. Ideally this can be accomplished with $.extend() in the Ctools modal settings.

CommentFileSizeAuthor
ctools-modal-sizing.patch284 bytespopulist
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

populist’s picture

Assigned: Unassigned » populist
Status: Patch (to be ported) » Needs work

There is probably a better way to do this by overriding the entire settings array that Ctools sets up. Assigning this to me and marking as active.

populist’s picture

Status: Needs work » Fixed

And there is, in fact, a better way! Here is the code I used to modify the default Chaos Tools modal:


  // Override the Chaos Tools Modal Default Settings
  $default_style = array(
    'CToolsModal' => array(
      'modalSize' => array(
        'type' => 'scale',
        'width' => '.8',
        'height' => '.8',
        'addWidth' => 0,
        'addHeight' => 0,
        'contentRight' => 25,
        'contentBottom' => 75,
      ),
      'modalOptions' => array(
        'opacity' => '.55',
        'background-color' => '#FFF',
      ),
      'animationSpeed' => 'fast',
      'modalTheme' => 'CToolsModalDialog',
      'throbberTheme' => 'CToolsModalThrobber',
    ),
  );
  drupal_add_js($default_style, 'setting');

Status: Fixed » Closed (fixed)

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

sylus’s picture

Status: Closed (fixed) » Active

Sorry for reopening this.

I was wanting to apply my own custom style to CToolsModal but it seems I can't copy what is in comment #2 and put it in my own hook_init. If I commit out the one in panopoly_core then everything works and I don't recieve a javascript conflict.

Would it be possibly to wrap this CTools customization in a variable_get in case someone wants to use their own custom style overriding CToolsModal?

sylus’s picture

Priority: Normal » Major

Elevating priority as not sure how to work around this ^_^

populist’s picture

Sounds reasonable. I moved the logic to Panopoly Magic as per #1899368: Allow Panopoly Magic to Work Without Panopoly Core, but this is now how the modal is called:

$modal_style = variable_get('panopoly_magic_modal_style', $default_style);
 drupal_add_js($modal_style, 'setting');
populist’s picture

Status: Active » Fixed

Committed to dev

Status: Fixed » Closed (fixed)

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