This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 1154afc7dc265d6e77d36394260704fce8e5f6be Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Tue Aug 26 15:02:24 2014 +0200 fixes sticky if not found #poll-inline --- .../src/main/webapp/js/scripts/sticky-inline-poll.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/scripts/sticky-inline-poll.js b/pollen-ui-angular/src/main/webapp/js/scripts/sticky-inline-poll.js index a38d128..828697b 100644 --- a/pollen-ui-angular/src/main/webapp/js/scripts/sticky-inline-poll.js +++ b/pollen-ui-angular/src/main/webapp/js/scripts/sticky-inline-poll.js @@ -21,12 +21,15 @@ $(window).scroll(function() { var pollInline = $('#poll-inline'); - var elementPosition = pollInline.offset(); - elementPosition.left -= parseInt($('#poll-content').css('marginLeft'), 10); + var pollContent = $('#poll-content'); + if (pollInline.length > 0 && pollContent.length > 0) { + var elementPosition = pollInline.offset(); + elementPosition.left -= parseInt(pollContent.css('marginLeft'), 10); - if($(window).scrollLeft() > elementPosition.left){ - pollInline.find('tr td:first-child').not('.static').addClass("sticky").css('left', $(window).scrollLeft() - elementPosition.left); - } else { - pollInline.find('tr td:first-child').not('.static').removeClass("sticky"); + if ($(window).scrollLeft() > elementPosition.left) { + pollInline.find('tr td:first-child').not('.static').addClass("sticky").css('left', $(window).scrollLeft() - elementPosition.left); + } else { + pollInline.find('tr td:first-child').not('.static').removeClass("sticky"); + } } }); -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.