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);

CommentFileSizeAuthor
#2 max_width_setting_does-2197233-2.patch729 bytesjoelpittet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

WIStudent’s picture

Issue summary: View changes
joelpittet’s picture

Status: Active » Needs review
FileSize
729 bytes

Reviewed 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.

joelpittet’s picture

Status: Needs review » Fixed

I've committed this, hopefully it resolves your issue @WIStudent

  • joelpittet committed e4012bc on 7.x-1.x
    Issue #2197233 by joelpittet, WIStudent: Max-width setting does not work
    

Status: Fixed » Closed (fixed)

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