Update Composer, update everything
This commit is contained in:
parent
ea3e94409f
commit
dda5c284b6
19527 changed files with 1135420 additions and 351004 deletions
59
web/modules/contrib/webform/js/webform.element.more.js
Normal file
59
web/modules/contrib/webform/js/webform.element.more.js
Normal file
|
@ -0,0 +1,59 @@
|
|||
/**
|
||||
* @file
|
||||
* JavaScript behaviors for element (read) more.
|
||||
*/
|
||||
|
||||
(function ($, Drupal) {
|
||||
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Element (read) more.
|
||||
*
|
||||
* @type {Drupal~behavior}
|
||||
*/
|
||||
Drupal.behaviors.webformElementMore = {
|
||||
attach: function (context) {
|
||||
$(context).find('.js-webform-element-more').once('webform-element-more').each(function (event) {
|
||||
var $more = $(this);
|
||||
var $a = $more.find('a');
|
||||
var $content = $more.find('.webform-element-more--content');
|
||||
|
||||
// Add aria-* attributes.
|
||||
$a.attr({
|
||||
'aria-expanded': false,
|
||||
'aria-controls': $content.attr('id')
|
||||
});
|
||||
|
||||
// Add event handlers.
|
||||
$a.on('click', toggle)
|
||||
.on('keydown', function (event) {
|
||||
// Space or Return.
|
||||
if (event.which === 32 || event.which === 13) {
|
||||
toggle(event);
|
||||
}
|
||||
});
|
||||
|
||||
function toggle(event) {
|
||||
var expanded = ($a.attr('aria-expanded') === 'true');
|
||||
|
||||
// Toggle `aria-expanded` attributes on link.
|
||||
$a.attr('aria-expanded', !expanded);
|
||||
|
||||
// Toggle content and more .is-open state.
|
||||
if (expanded) {
|
||||
$more.removeClass('is-open');
|
||||
$content.slideUp();
|
||||
}
|
||||
else {
|
||||
$more.addClass('is-open');
|
||||
$content.slideDown();
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery, Drupal);
|
Reference in a new issue