3 * The Superfish Drupal Behavior to apply the Superfish jQuery plugin to lists.
6 (function ($, Drupal, drupalSettings) {
11 * jQuery Superfish plugin.
13 * @type {Drupal~behavior}
15 * @prop {Drupal~behaviorAttach} attach
16 * Attaches the behavior to an applicable <ul> element.
18 Drupal.behaviors.superfish = {
19 attach: function (context, drupalSettings) {
20 // Take a look at each menu to apply Superfish to.
21 $.each(drupalSettings.superfish || {}, function (index, options) {
22 var $menu = $('ul#' + options.id, context);
24 // Check if we are to apply the Supersubs plug-in to it.
25 if (options.plugins || false) {
26 if (options.plugins.supersubs || false) {
27 $menu.supersubs(options.plugins.supersubs);
31 // Apply Superfish to the menu.
32 $menu.superfish(options.sf);
34 // Check if we are to apply any other plug-in to it.
35 if (options.plugins || false) {
36 if (options.plugins.touchscreen || false) {
37 $menu.sftouchscreen(options.plugins.touchscreen);
39 if (options.plugins.smallscreen || false) {
40 $menu.sfsmallscreen(options.plugins.smallscreen);
42 if (options.plugins.supposition || false) {
49 })(jQuery, Drupal, drupalSettings);