Advertisement
cbl4

VK.Widgets.CommunityMessages expand event

Jan 13th, 2018
602
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var communityWidget = VK.Widgets.CommunityMessages("vk_community_messages", '#YOUR_COMMUNITY_ID#');
  2. setTimeout(function(){
  3.     var widgetID = document.getElementById('vk_community_messages').getElementsByTagName('iframe')[0].getAttribute('id').replace('vkwidget', '');
  4.     var _community_xdm= VK.Widgets.RPC[widgetID];
  5.     _community_xdm.methods._origin_expand = _community_xdm.methods.expand;
  6.     _community_xdm.methods.expand = function( opts ){
  7.         /** your code here */
  8.         _community_xdm.methods._origin_expand (opts);
  9.     }
  10. }, 200);
Advertisement
RAW Paste Data Copied
Advertisement