tabalinas / jssocials

Social Network Sharing jQuery Plugin
http://js-socials.com
MIT License
464 stars 104 forks source link

Turn off window share #202

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi,

is there anyway i could turnoff window for a specific share?

I am using FB.ui to open a dialog window. This is implemented inside

on: {
  click: function(e){})
}

FB.ui({
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
    object: {
        'og:url': overrideLink,
        'og:title': overrideTitle,
        'og:description': overrideDescription,
        'og:image': overrideImage
    }
})
}, function(response) {});](url)

So i dont need the defualt window to be opened, when i click the facebook-share button.

ghost commented 6 years ago

I solved the problem.

jsSocials.shareStrategies["fb-customShareStrategy"] = function(args) {
  return $("<a href='#'>").click(function(e) {
    e.preventDefault();
    shareOverrideOGMeta("","","","");
  });
};