* });
*/
-(function (Drupal, debounce) {
+(function(Drupal, debounce) {
let liveElement;
const announcements = [];
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
- * Attaches the behavior for drupalAnnouce.
+ * Attaches the behavior for drupalAnnounce.
*/
Drupal.behaviors.drupalAnnounce = {
attach(context) {
*
* @see http://www.w3.org/WAI/PF/aria-practices/#liveprops
*/
- Drupal.announce = function (text, priority) {
+ Drupal.announce = function(text, priority) {
// Save the text and priority into a closure variable. Multiple simultaneous
// announcements will be concatenated and read in sequence.
announcements.push({
// Immediately invoke the function that debounce returns. 200 ms is right at
// the cusp where humans notice a pause, so we will wait
// at most this much time before the set of queued announcements is read.
- return (debounce(announce, 200)());
+ return debounce(announce, 200)();
};
-}(Drupal, Drupal.debounce));
+})(Drupal, Drupal.debounce);