versolearning / meteor-intercom

Reactive intercom integration for Meteor
47 stars 15 forks source link

Change widget / activator id? #18

Closed nadeemja closed 8 years ago

nadeemja commented 9 years ago

How do I do it with this package?

dburles commented 8 years ago

@nadeemja can you provide some more detail?

nadeemja commented 8 years ago

Hello!

A while since I worked on this, but I think I figured it out. If I recall correctly, you just specify this where you specify all the other settings :)

nadeemja commented 8 years ago

Okey, so I forgot how to do this, and just spent an hour figuring it out again. Putting it here for next time and for others:

IntercomSettings.userInfo = function ( user, info ) {

    ...

    info.widget = {
        "activator": "#YourElement"
    };

};
morgs32 commented 8 years ago

Any chance you figured out how to change the activator dynamically? Such as - use the default one when it's suitable, but when there's a lot of content behind it in the bottom right hand part of the screen, switch to a custom activator button

shelkie commented 8 years ago

Should be able to hide the default launcher with CSS #intercom-launcher{display:none;} and then trigger its click event when your custom button is clicked. $('.customButton').click(function(){ $('#intercom-launcher').trigger('click'); });