Socialite icon indicating copy to clipboard operation
Socialite copied to clipboard

Xing Button - loaded div removed

Open royroosterz opened this issue 12 years ago • 2 comments

Hi,

I am trying to embed the Xing Share button in socialite. The button is working, but for some reason the classes "socialite xing-share socialite-instance socialite-loaded" are removed after rendering the button.

This is the socialite.xing.js file:

(function(window, document, Socialite, undefined) {

    Socialite.setup({
        'xing': {
            lang: 'de',
            count: 'horizontal'
        }
    });

    // https://dev.xing.com/plugins/share_button

    Socialite.network('xing', {
        script: {
            src: '//www.xing-share.com/js/external/share.js',
            charset : 'utf-8'
        }
    });

    Socialite.widget('xing', 'share', {

        init: function(instance)
        {
            var el = document.createElement('div');
            Socialite.copyDataAttributes(instance.el, el);

            el.setAttribute('data-counter', instance.el.getAttribute('data-counter') || Socialite.settings.xing.count);
            el.setAttribute('data-url', instance.el.getAttribute('data-url'));
            el.setAttribute('data-lang', instance.el.getAttribute('data-lang') || Socialite.settings.xing.lang);

            instance.el.appendChild(el);
            Socialite.activateInstance(instance);
        }
    });

})(window, window.document, window.Socialite);

Anybody have a clou what needs to be changed in order to keep the classes? These are needed for CSS styling.

Thanks and cheers, Roy

royroosterz avatar Aug 05 '13 22:08 royroosterz

Roy,

I just implemented your xing extension into a local branch and I'm seeing the classes stay on load, but the actual xing button itself isn't loading. Is the button loading for you?

Please paste your actual markup for the button as well, not just the extension, that way I can diagnose further.

tmort avatar Sep 20 '13 16:09 tmort

Hi Tom,

I have attached a version that works for me!

Cheers, Roy

On Fri, Sep 20, 2013 at 6:16 PM, Tom Morton [email protected]:

Roy,

I just implemented your xing extension into a local branch and I'm seeing the classes stay on load, but the actual xing button itself isn't loading. Is the button loading for you?

Please paste your actual markup for the button as well, not just the extension, that way I can diagnose further.

— Reply to this email directly or view it on GitHubhttps://github.com/tmort/Socialite/issues/67#issuecomment-24821971 .

royroosterz avatar Sep 30 '13 15:09 royroosterz