roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

labels and checkboxes: some display improvements?

Open nicolasfranck opened this issue 4 years ago • 5 comments

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

3.0.2

Improvements:

  • in the contributor tab of a plan a tooltip is attached to the checkbox. Better not attach it to the label that wraps both text and checkbox? Otherwise you'll see the help text too late.

  • checkboxes with text next to it should be activated by clicking on the text. This can be done by either wrapping the checkbox in a label, or by setting the attributor "for" of a label. e.g. list of themes in the template editor.

  • in the share tab of a plan one single tooltip is shown if you hover over the available permission options. Better not split this apart? That would make it more readable, I think.

nicolasfranck avatar Jul 01 '21 07:07 nicolasfranck

Yes agree on all counts.

briri avatar Jul 01 '21 14:07 briri

@nicolasfranck would you have the time to have a go at this one? would be great if so. Cheers.

raycarrick-ed avatar Jul 15 '21 12:07 raycarrick-ed

@briri

There is a problem with this commit: https://github.com/DMPRoadmap/roadmap/pull/2333/files

If I add a label to every theme, it automatically changes the attribute for so it points to the tinymce iframe.

nicolasfranck avatar Aug 02 '21 09:08 nicolasfranck

yes, good catch. That is far too generic and I can confirm that its doing this on other pages that have multiple tinymce editors. Instead of using iframe.closest('form').find('label');

Maybe something like:

const textarea = iframe.closest('.mce-container').siblings('textarea.tinymce')[0];
if (isObject(textarea)) {
  const lbl = $(`label[for="${textarea.attr('id')}"]`);
  if (isObject(lbl)) {
    // Connect the label to the iframe
    lbl.attr('for', iframe.attr('id'));
  }
}

briri avatar Aug 02 '21 14:08 briri

Another option would be to perhaps use this: https://www.tiny.cloud/docs-4x/api/tinymce.ui/tinymce.ui.label/

That may mean passing the label into the init function.

briri avatar Aug 02 '21 14:08 briri