Why not fire the js code?

Have the html button of this type

<div class="story__share" title="Share"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--story__share"><use xlink:href="#story--icon__share"></use></svg></div>

<div class="social" style="display: none" data-url="" data-title="" data-image="" data-description="" data-time="">
 <a href="" target="_blank" rel="nofollow noopener" class="social__button" data-type="vk"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--social__vk"><use xlink:href="#icon--social__vk"></use></svg></a>
 <a href="" target="_blank" rel="nofollow noopener" class="social__button" data-type="facebook"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--social__facebook"><use xlink:href="#icon--social__facebook"></use></svg></a>
 <a href="" target="_blank" rel="nofollow noopener" class="social__button" data-type="twitter"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--social__twitter"><use xlink:href="#icon--social__twitter"></use></svg></a>
 </div>


By clicking on

<div class="story__share" title="Share"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--story__share"><use xlink:href="#story--icon__share"></use></svg></div>


it takes a style="display:none; hiding place this button appear

<div class="social" style="" data-url="" data-title="" data-image="" data-description="" data-time="">
 <a href="" target="_blank" rel="nofollow noopener" class="social__button" data-type="vk"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--social__vk"><use xlink:href="#icon--social__vk"></use></svg></a>
 <a href="" target="_blank" rel="nofollow noopener" class="social__button" data-type="facebook"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--social__facebook"><use xlink:href="#icon--social__facebook"></use></svg></a>
 <a href="" target="_blank" rel="nofollow noopener" class="social__button" data-type="twitter"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon--social__twitter"><use xlink:href="#icon--social__twitter"></use></svg></a>
 </div>


But the js that should handle the whole thing

_attachSocialButton() {
 return !!this.$(".social").length && (["story"].includes(this.feedName) && new N(this.$(".social")), this.$el.on("click", ".story__share", t => V(t.currentTarget).hide().next().fadeIn(300)), this)
 }


but for some reason it does not work... please tell me how to run it
March 19th 20 at 08:35
0 answer

Find more questions by tags JavaScript