You are here

function hook_shs_FIELDNAME_js_settings_alter in Simple hierarchical select 2.0.x

Same name and namespace in other branches
  1. 8 shs.api.php \hook_shs_FIELDNAME_js_settings_alter()
  2. 7 shs.api.php \hook_shs_FIELDNAME_js_settings_alter()

Alter Javascript settings for a single shs widget.

Parameters

array $settings_shs: Javascript settings for the specified field.

string $bundle: Bundle name of vocabulary the settings are used for.

string $field_name: Name of field the provided settings are used for.

File

./shs.api.php, line 68
Hooks for the shs module.

Code

function hook_shs_FIELDNAME_js_settings_alter(array &$settings_shs, $bundle, $field_name) {
  $settings_shs['labels'] = [
    // No label for first level.
    FALSE,
    t('Country'),
    t('City'),
  ];

  // Small speed-up for anmiations (defaults to 400ms).
  $settings_shs['display']['animationSpeed'] = 100;
}