Sha256: 9af77fa96aacfc1d156bcdd3b5da84bf3a97c119cd5a311667e1c4251bdc6b73

Contents?: true

Size: 979 Bytes

Versions: 1

Compression:

Stored size: 979 Bytes

Contents

class @SharingTags.Share.Callback
  constructor: (@share)->
    @network = @share.network
    @context = @share.context

  click_action: (params)=>
    @trigger("click_action", params)

  before_share: (provider)=>
    @trigger("before_share", provider: provider)

  success_share: (response)->
    @trigger("success_share", response: response)

  cancel_share: (response)->
    @trigger("cancel_share", response: response)

  after_share: (response)->
    @trigger("after_share", response: response)

  open_popup: (open_url, popup_window)=>
    @trigger("open_popup", url: open_url, popup_window: popup_window)

  trigger: (trigger_name, params...)->
    params['type'] = "sharing_tags.#{trigger_name}"
    trigger_params = @_share_params(params)
    jQuery?(document).trigger(trigger_params)

  _share_params: (params)->
    properties = {
      url: @share.url
      network: @network
      context: @context
    }
    params[key] = val for key, val of properties
    params

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sharing_tags-0.0.18 app/assets/javascripts/sharing_tags/share/callback.js.coffee