Regardless of what option is chosen under Link type, the template outputs a throbber. In my case it was adding some unwanted space below the flag.

I think the throbber should only be output when the link type is toggle.

Comments

sagannotcarl’s picture

StatusFileSize
new832 bytes
shabana.navas’s picture

As it is, the throbber only appears when the link type is toggle. Maybe you have some other module, theme, or css outputting a throbber and adding that extra space under flag.

sagannotcarl’s picture

Hmm, maybe I'm confused. Doesn't this part of the flag.tpl.php output the throbber span regardless of type?

<a href="<?php print $link_href; ?>" title="<?php print $link_title; ?>" class="<?php print $flag_classes ?>" rel="nofollow"><?php print $link_text; ?></a><span class="flag-throbber">&nbsp;</span>

joachim’s picture

It does, but that's an empty SPAN. I suspect that the JS only turns that into an actual throbber when it's been loaded for the JS link type.

sagannotcarl’s picture

Title: Only display throbber when the flag type is toggle » Only display throbber markup when the flag type is toggle

Yes, you are correct that it's empty, but it's still unnecessary markup that happened to have unintended in my situation. It seems to me that if the flag is specifically configured to not use javascript, then it's a best practice to not generate js-only markup.

sagannotcarl’s picture

@joachim Actually looking at this again it's not actually an empty span, it's a span with a non-breaking space in it.

Scott Robertson’s picture

StatusFileSize
new857 bytes

This appears to still be an issue in the 7.x-3.x branch. @sagannotcarl is correct, the span actually has a non-breaking space, which can actually cause display issues, as was my case.

On a related note, I believe it also makes sense to hide the throbber span via CSS when it shouldn't actually be active. This way there aren't any markup issues, and the flag-throbber.gif can actually be loaded by the browser when the page is initially loaded, as opposed to when the link is actually clicked.

The attached patch adds to @sagannotcarl's patch to also make these CSS adjustments.

Scott Robertson’s picture

Status: Active » Needs review
Scott Robertson’s picture

StatusFileSize
new1.24 KB

Whoops, wrong patch :). Attaching the correct one.

The last submitted patch, 7: 2168685-undesired-people-search-performed-6.patch, failed testing.

ivnish’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is EOL. Issue will be closed, but patches are still here