<script> // ak sme nemali este definovanu funkciu, tak zadefinujeme aj nastavime listener
if (!window.votingIframeResizer) {
window.votingIframeResizer = function(event) {
if (!'{baseUri}'.startsWith(event.origin)) {
return; }
if (event.data.votingContainerSize) {
var iframeWrapper = document.getElementById('voting_'+event.data.votingContainerSize.votingId+'_wrapper');
if (iframeWrapper) {
iframeWrapper.style.height = (event.data.votingContainerSize.height) + 'px'; } } }
window.votingIframeScrolltop = function(iframe) {
var iframeId = iframe.getAttribute('id');
if (!window.votingIframeScrolltopCounter[iframeId]) {
window.votingIframeScrolltopCounter[iframeId] = 1; }
else {
window.votingIframeScrolltopCounter[iframeId] += 1; }
if (window.votingIframeScrolltopCounter[iframeId] > 1) {
iframe.scrollIntoView(true); } }
window.votingIframeScrolltopCounter = {}; window.addEventListener("message", window.votingIframeResizer, false); }
</script>
<div style="overflow:hidden;-webkit-overflow-scrolling:touch;max-width:800px;margin: 0 auto;" id="voting_{id}_wrapper">
<iframe src="{baseUri}{id}" frameborder="0" id="voting_{id}" style="width:100%;height:100%;" onLoad="window.votingIframeScrolltop(this);">
</iframe></div>