/** * Created with IntelliJ IDEA. * User: vurdalak * Date: 21.09.13 * Time: 15:21 * To change this template use File | Settings | File Templates. */ function addPopups() { $('a').each(function() { if($(this).text().indexOf('>>') == 0) { var refNum = $(this).text().match(/\d+/); if (refNum != null) { var self = $(this); $(this).mouseenter(function() { $.get('/get_post/' + refNum, function(data) { var popup = $('
').html(data) popup.dialog({ modal: false, minHeight: 0, }); popup.position({ my: "left+20 top+20", at: "right bottom", of: self }) self.mouseleave(function() { if (popup != null) { popup.remove(); } }); }) }); } } }); }