ref: master
plugins/vote/public/vote_actions.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
var openEvent = null; jQuery( document ).ready(function( $ ) { $(".vote-action").live('mouseenter', function() { var div = $(this); if(openEvent==null) openEvent = setInterval(function() { openVotersDialog(div); }, 500); }); $(".vote-action").live('mouseleave', function() { clearTimeout(openEvent); openEvent = null; }); }); function openVotersDialog(div) { var $ = jQuery; clearTimeout(openEvent); var url = $(div).data('reload_url'); hideAllVoteDetail(); if(url && url != '#'){ $.post(url); } } jQuery('body').live('click', function() { hideAllVoteDetail(); }); function hideAllVoteDetail() { jQuery('.vote-detail').fadeOut('slow'); } |