/* * Dropdown menus. * * This script customizes the Twitter Bootstrap drop-downs. * * Require: * - bootstrap/dropdown */ +function ($) { "use strict"; $(document).on('shown.bs.dropdown', '.dropdown', function(event, relatedTarget) { $(document.body).addClass('dropdown-open') var dropdown = $(relatedTarget.relatedTarget).siblings('.dropdown-menu'), dropdownContainer = $(this).data('dropdown-container') // The dropdown menu should be a sibling of the triggering element (above) // otherwise, look for any dropdown menu within this context. if (dropdown.length === 0){ dropdown = $('.dropdown-menu', this) } if ($('.dropdown-container', dropdown).length == 0) { var title = $('[data-toggle=dropdown]', this).text(), titleAttr = dropdown.data('dropdown-title'), timer = null if (titleAttr !== undefined) title = titleAttr $('li:first-child', dropdown).addClass('first-item') $('li:last-child', dropdown).addClass('last-item') dropdown.prepend($('
  • ').addClass('dropdown-title').text(title)) var container = $('
  • ').addClass('dropdown-container'), ul = $('