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/web/modules/contrib/webform/js/webform.admin.dropbutton.js
2018-11-23 12:29:20 +00:00

27 lines
631 B
JavaScript

/**
* @file
* Dropbutton feature.
*/
(function ($, Drupal) {
'use strict';
// Make sure that dropButton behavior exists.
if (!Drupal.behaviors.dropButton) {
return;
}
/**
* Wrap Drupal's dropbutton behavior so that the dropbutton widget is only visible after it is initialized.
*/
var dropButton = Drupal.behaviors.dropButton;
Drupal.behaviors.dropButton = {
attach: function (context, settings) {
dropButton.attach(context, settings);
$(context).find('.webform-dropbutton .dropbutton-wrapper').once('webform-dropbutton').css('visibility', 'visible');
}
};
})(jQuery, Drupal);