Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, the modalBackdrop color and opacity are hardcoded into modal.js, making it impossible to theme. I added those options to the Drupal.settings.CToolsModal object -- in line with how the closeText, closeImage, and throbber work. Here's the change:
var opts = {
// @todo this should be elsewhere.
opacity: Drupal.settings.CToolsModal.backDropOpacity,
background: Drupal.settings.CToolsModal.backDropColor
};
...and then reflected in modal.inc
$settings = array('CToolsModal' => array(
'closeText' => t('Close Window'),
'closeImage' => theme('image', ctools_image_path('icon-close-window.png'), t('Close window'), t('Close window')),
'throbber' => theme('image', ctools_image_path('throbber.gif'), t('Loading...'), t('Loading')),
'backDropOpacity' => '.55',
'backDropColor' => '#fff'
));
Comment | File | Size | Author |
---|---|---|---|
modal-opts.patch | 1.23 KB | jasonn1234 |
Comments
Comment #1
sdboyer CreditAttribution: sdboyer commentedMakes total sense to me. Committed. Thanks!
Comment #3
geerlingguy CreditAttribution: geerlingguy commentedWas this ever forward-ported to 7.x-1.x?
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedIt should have been, we did a merge late in 2010. Can you verify it's not in 7.x?
Comment #5
geerlingguy CreditAttribution: geerlingguy commentedNevermind, it was my own dumb code not working... :)