I just tried out embedding a token_tree in a module admin page and, while it was pretty simple and awesome, I wasn't able to click_insert tokens like it said at the top of the table.
I then realized that I didn't have JS on, which is why it didn't work (with JS it works beautifully), but it was weird that the table told me it would work.
Attached patch adds the 'element-hidden' class to the caption and removes that via JS, so that the caption is only shown with JS on. It then leaves a useless < span > laying around, but I'm not sure whether/how it's possible to add attributes to the caption itself.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tstoeckler’s picture

Title: Table caption mentionen click_insert should only be visible with JS on » Table caption mentioning click_insert should only be visible with JS on
Assigned: Unassigned » tstoeckler

fixing title, assigning to me, and bump.

Chris Matthews’s picture

Assigned: tstoeckler » Unassigned
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 8 year old patch to token.pages.inc does not apply to the latest token 7.x-1.x-dev and if still applicable needs reroll.

Checking patch token.js...
Hunk #1 succeeded at 4 (offset -1 lines).
Checking patch token.pages.inc...
error: while searching for:
    'empty' => t('No tokens available.'),
  );
  if ($variables['click_insert']) {
    $table_options['caption'] = t('Click a token to insert it into the field you\'ve last clicked.');
    $table_options['attributes']['class'][] = 'token-click-insert';
  }

error: patch failed: token.pages.inc:90
error: token.pages.inc: patch does not apply
Andrew Answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
906 bytes

Patch re-rolled.