Download & Extend

AddToAny buttons should not retain the class-name of "a2a_dd" (for asynchronous loading)

Project:Share Buttons (AddToAny) by Lockerz
Version:6.x-3.2
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

The dropdown menu only seems to work on the first node in a list of nodes (Views) in Firefox. It works ok in IE.

Looking at the source, the following javascript is only present in the first node (not sure if that is as intended or not).

<script type="text/javascript">
function da2a_script_onready() { da2a_script_ready = true; if(da2a_html_ready) da2a_init(); }
var a2a_config = a2a_config || {}, da2a_html_ready = da2a_script_ready = false; a2a_config.tracking_callback = ['ready', da2a_script_onready];
(function(){var a = document.createElement('script');a.type = 'text/javascript';a.async = true;a.src = 'http://static.addtoany.com/menu/page.js';var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(a, s);})();
</script>

Comments

#1

Component:User interface» Miscellaneous

#2

Assigned to:Anonymous» micropat
Status:active» postponed (maintainer needs more info)

That JavaScript is intentionally outputted after the first node only (for asynchronous loading).

However, you should see some AddToAny-related JavaScript right before your closing tag. What does that show?

#3

<script type="text/javascript">
da2a_html_ready = true;
function da2a_init(){if(da2a_script_ready){
a2a_config.linkname='node title 1'; a2a_config.linkurl='http://localhost/content/node-title-1'; a2a.init('page', {target: '#da2a_1'});
a2a_config.linkname='node title 2'; a2a_config.linkurl='http://localhost/content/node-title-2'; a2a.init('page', {target: '#da2a_2'});
a2a_config.linkname='node title 3'; a2a_config.linkurl='http://localhost/content/node-title-3'; a2a.init('page', {target: '#da2a_3'});
a2a_config.linkname='node title 4'; a2a_config.linkurl='http://localhost/content/node-title-4'; a2a.init('page', {target: '#da2a_4'});
a2a_config.linkname='node title 5'; a2a_config.linkurl='http://localhost/content/node-title-5'; a2a.init('page', {target: '#da2a_5'});
a2a_config.linkname='node title 6'; a2a_config.linkurl='http://localhost/content/node-title-6'; a2a.init('page', {target: '#da2a_6'});
a2a_config.linkname='node title 7'; a2a_config.linkurl='http://localhost/content/node-title-7'; a2a.init('page', {target: '#da2a_7'});
}}</script>

#4

It may be an issue of AddToAny buttons retaining the class-name of "a2a_dd", which they shouldn't due to asynchronous loading. This is fixed in the dev version.

Can you tell me if using the snapshot release resolves the issue you're having?

Snapshot release: http://drupal.org/node/838616

#5

Title:Dropdown menu only works for first node in a view list (firefox)» Dropdown menu not working
Status:postponed (maintainer needs more info)» active

dropdown menu is not working in IE8, Firefox, Safari, and Chrome

Tried flushing caches and toggling dropdown feature. No effect.

#6

@rrbachamp Do you have the same issue, or are none of your drop-downs functioning? Did you try the snapshot release? http://drupal.org/node/838616

#7

Please give the next dev release a try (or version 3.2). This release contains some important bug fixes for asynchronous loading, which should also fix this issue.

#8

I've had this problem, with my own attempts at a Drupal theme. Turns out, I didn't have the php $closure variable printed at the end of the theme. Whoops. Working now.

A quick test: does it work for you if you switch to the Bluemarine theme?

#9

Can you tell me if using the snapshot release resolves the issue you're having?

Yep, it seems to work now using the snapshot release.

edit: also works in 6.x-3.2

#10

I'm seeing this behavior in the 3.2 release in Safari & Firefox. Haven't tested IE.
Flushed caches and confirmed that the "a2a_dd" calls is not present.

#11

Nevermind, i was using old options names in the "Additional options" settings.

a2a_onclick=1;a2a_track_links='awesm';a2a_track_links_key='my_key';a2a_init('page');

should now be

a2a_config.onclick = 1;a2a_config.track_links = 'awesm';a2a_config.track_links_key = 'my_key';

#12

Version:6.x-3.1» 6.x-3.2

I upgraded to 3.2 and flushed caches, the menu is still not working at all in Firefox. Works fine in IE 8. I have the button in the Links section and nothing entered in Additional Options.

#13

@fred0, AddToAny is backwards-compatible with the old API syntax. The only problem was a2a_init('page');. Not sure why you had that there. :)

#14

@foraker Are you getting any JavaScript errors? Troubleshooting would be easier if you could link us to your site (or source).

#15

Title:Dropdown menu not working» AddToAny buttons should not retain the class-name of "a2a_dd" (for asynchronous loading)
Assigned to:micropat» Anonymous
Status:active» fixed

Yep, it seems to work now using the snapshot release.

edit: also works in 6.x-3.2

Marking this issue as fixed and giving it a detailed title since clockwood reports that this specific issue is fixed in 3.2.

Please start a new issue if the drop-down is not appearing for you.

#16

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#17

I continue to get the same error in ie8 and the css is really meshed up.
I use version 6.x-3.3.Is there any workaround for this?

#18

For anyone wanting the code for making a 'share this' block (namely for facebook,twitter,delicious and LinkedIn), the HTML:

<div id="socialicons" style="position:relative;">
<a href="#" onclick="return universal('facebook')" target="_blank"><img alt="Share on Facebook" class="socialicon" src="/path/to/facebook/image.png"></a>
<a href="#" onclick="return universal('twitter')" title="Click to share this post on Twitter"><img class="socialicon" src="/path/to/twitter.png"></a>
<a href="#" onclick="return universal('linkedin')"><img class="socialicon" src="/path/to/linkedin.png"></a>
<a href="#" onclick="return universal('delicious')"><img class="socialicon" src="/path/to/delicious.png"></a>
</div>

and the javascript :

function universal(what)
{
        var link = '';
var title = '&t';
        switch (what){
  case 'facebook':
                  link = 'http://www.facebook.com/sharer.php?u=';
                  break;
  case 'delicious':
                  link = 'http://delicious.com/save?v=5&amp;noui&amp;jump=close&amp;url=';
  title = '&title=';
                  break;
  case 'twitter':
  link = 'http://twitter.com/home?status=Currently reading';
  title = 'title=';
  break;
  case 'linkedin' :
  link = 'http://www.linkedin.com/shareArticle?mini=true&url=';
  title = '&title=';
  break;
       }
        u=location.href;
t=document.title;
        window.open(link+encodeURIComponent(u)+title+encodeURIComponent(t),' sharer', 'toolbar=0, status=0, width=726, height=436');
        return false;
}

apply the css and it's ready..

nobody click here