You are here

function responsive_menus_simple_style_js_settings in Responsive Menus 7

JS callback from hook_responsive_menus_style_info().

1 string reference to 'responsive_menus_simple_style_js_settings'
responsive_menus_responsive_menus_style_info in ./responsive_menus.module
Implements hook_responsive_menus_style_info().

File

./responsive_menus.module, line 535
Responsify menus in Drupal.

Code

function responsive_menus_simple_style_js_settings($js_defaults = array()) {
  $js_settings = array(
    'toggler_text' => responsive_menus_var_get('responsive_menus_simple_text', '☰ Menu', $js_defaults),
    'selectors' => responsive_menus_explode_list('responsive_menus_css_selectors', '#main-menu', $js_defaults),
    'media_size' => responsive_menus_var_get('responsive_menus_media_size', 768, $js_defaults),
    'media_unit' => responsive_menus_var_get('responsive_menus_media_unit', 'px', $js_defaults),
  );
  $absolute = responsive_menus_var_get('responsive_menus_simple_absolute', array(
    1 => 1,
  ), $js_defaults);
  $disable_mouse = responsive_menus_var_get('responsive_menus_disable_mouse_events', array(
    1 => 0,
  ), $js_defaults);
  $remove_attributes = responsive_menus_var_get('responsive_menus_remove_attributes', array(
    1 => 1,
  ), $js_defaults);
  if ($absolute[1]) {
    $js_settings['absolute'] = TRUE;
  }
  if ($disable_mouse[1]) {
    $js_settings['disable_mouse_events'] = TRUE;
  }
  if ($remove_attributes[1]) {
    $js_settings['remove_attributes'] = TRUE;
  }
  return $js_settings;
}