Sha256: fb3da3c5264260131c830cd9a185de0bbdc536b21956144a664e551af293c516

Contents?: true

Size: 445 Bytes

Versions: 4

Compression:

Stored size: 445 Bytes

Contents

update_icons = (icons_json)->
  sharing_tags = $("@sharing_tags_share")

  $.each sharing_tags, (_, sharing_link)->
    link = $(sharing_link)
    network = link.data('network')
    link.html icon if icon = icons_json[network]


icons_json = {}
<% SharingTags::Network.lists.each do |network| %>
icons_json['<%= network %>'] = '<%= SharingTags::AssetFile.named("sharing_tags/icons/#{network}.svg") %>';
<% end %>

$ ->
  update_icons(icons_json)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sharing_tags-0.0.18 app/assets/javascripts/sharing_tags/icons.js.coffee.erb
sharing_tags-0.0.17 app/assets/javascripts/sharing_tags/icons.js.coffee.erb
sharing_tags-0.0.16 app/assets/javascripts/sharing_tags/icons.js.coffee.erb
sharing_tags-0.0.15 app/assets/javascripts/sharing_tags/icons.js.coffee.erb