views-contextual.js 520 B

12345678910111213141516
  1. /**
  2. * @file
  3. * JavaScript related to contextual links.
  4. */
  5. (function ($) {
  6. Drupal.behaviors.viewsContextualLinks = {
  7. attach: function (context) {
  8. // If there are views-related contextual links attached to the main page
  9. // content, find the smallest region that encloses both the links and the
  10. // view, and display it as a contextual links region.
  11. $('.views-contextual-links-page', context).closest(':has(".view"):not("body")').addClass('contextual-links-region');
  12. }
  13. };
  14. })(jQuery);