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.
The max-width setting does not work.
It is because the value was set up in the array with the key "max_width", but the javascript tries to access it with "maxWidth".
formtips.module:
/**
* Generates the JS settings array.
*/
function formtips_js_settings() {
$selectors = explode("\r\n", variable_get('formtips_selectors', FORMTIPS_SELECTORS));
return array('formtips' => array(
'selectors' => $selectors,
'interval' => variable_get('formtips_interval', FORMTIPS_INTERVAL),
'sensitivity' => variable_get('formtips_sensitivity', FORMTIPS_SENSITIVITY),
'timeout' => variable_get('formtips_timeout', FORMTIPS_TIMEOUT),
'max_width' => variable_get('formtips_max_width', FORMTIPS_MAX_WIDTH),
'trigger_action' => variable_get('formtips_trigger_action', 'hover'),
));
}
formtips.js
$('.form-item .description.formtips-processed').css('max-width', settings.maxWidth);
Comment | File | Size | Author |
---|---|---|---|
#2 | max_width_setting_does-2197233-2.patch | 729 bytes | joelpittet |
Comments
Comment #1
WIStudent CreditAttribution: WIStudent commentedComment #2
joelpittetReviewed and tested, that's right. Also added a small micro-optimization from calling $() more than necessary in the loop.
Here's your code in the OP in a patch.
Comment #3
joelpittetI've committed this, hopefully it resolves your issue @WIStudent