From 4e7b8c7536dba4785bc35683e0be9446fb83ddb3 Mon Sep 17 00:00:00 2001 From: Vasantha Deepika <65262-Vasantha_Deepika@users.noreply.drupalcode.org> Date: Fri, 14 Feb 2025 08:29:50 +0000 Subject: [PATCH] Resolve #3495320 "Show row weights" --- js/overrides/tabledrag.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/js/overrides/tabledrag.js b/js/overrides/tabledrag.js index 905716263..2e645ec25 100644 --- a/js/overrides/tabledrag.js +++ b/js/overrides/tabledrag.js @@ -1813,8 +1813,22 @@ * @return {string} * HTML markup for the weight toggle button content.s */ - toggleButtonContent: (show) => - show ? Drupal.t('Hide row weights') : Drupal.t('Show row weights'), + toggleButtonContent: (show) => { + const classes = [ + 'action-link', + 'action-link--extrasmall', + 'tabledrag-toggle-weight', + ]; + let text = ''; + if (show) { + classes.push('action-link--icon-hide'); + text = Drupal.t('Hide row weights'); + } else { + classes.push('action-link--icon-show'); + text = Drupal.t('Show row weights'); + } + return `<span class="${classes.join(' ')}">${text}</span>`; + }, /** * @return {string} -- GitLab