tmort / Socialite

Other
1.68k stars 164 forks source link

Xing Button - loaded div removed #67

Open royroosterz opened 10 years ago

royroosterz commented 10 years ago

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

tmort commented 10 years ago

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.

royroosterz commented 10 years ago

Hi Tom,

I have attached a version that works for me!

Cheers, Roy

On Fri, Sep 20, 2013 at 6:16 PM, Tom Morton notifications@github.comwrote:

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 .