Skip to content
Snippets Groups Projects
Commit 9dfc2d82 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

Issue #1905340 by plopesc, Wim Leers: Fixed Contextual Links Needs Title to be...

Issue #1905340 by plopesc, Wim Leers: Fixed Contextual Links Needs Title to be Included in 'Open configuration options button'.
parent b40ef7df
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -57,8 +57,10 @@ Drupal.contextual.prototype.init = function() {
// Create and append the contextual links trigger.
var action = Drupal.t('Open');
var parentBlock = this.$region.find('h2').first().text();
this.$trigger = $(Drupal.theme.contextualTrigger())
.text(Drupal.t('@action configuration options', {'@action': action}))
.text(Drupal.t('@action @parent configuration options', {'@action': action, '@parent': parentBlock}))
// Set the aria-pressed state.
.attr('aria-pressed', false)
.prependTo(this.$wrapper);
......@@ -151,8 +153,9 @@ Drupal.contextual.prototype.showLinks = function(show) {
this.$wrapper.toggleClass('contextual-links-active', show);
var isOpen = this.$wrapper.hasClass('contextual-links-active');
var action = (isOpen) ? Drupal.t('Close') : Drupal.t('Open');
var parentBlock = this.$region.find('h2').first().text();
this.$trigger
.text(Drupal.t('@action configuration options', {'@action': action}))
.text(Drupal.t('@action @parent configuration options', {'@action': action, '@parent': parentBlock}))
// Set the aria-pressed state.
.attr('aria-pressed', isOpen);
// Mark the links as hidden if they are.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment