This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/core/modules/views/js/views-contextual.js

29 lines
587 B
JavaScript

/**
* @file
* Javascript related to contextual links.
*/
(function ($) {
"use strict";
/**
* Attaches contextual region classes to views elements.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Adds class `contextual-region` to views elements.
*/
Drupal.behaviors.viewsContextualLinks = {
attach: function (context) {
var id = $('body').attr('data-views-page-contextual-id');
$('[data-contextual-id="' + id + '"]')
.closest(':has(.view)')
.addClass('contextual-region');
}
};
})(jQuery);