From 513103169e59be0daf3275f4b370e009f8039f19 Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 18 Jan 2012 15:53:11 +0530 Subject: [PATCH] post load query function to goto comments, etc --- itf/static/js/insidepage.js | 19 +++++++++++++++++++ itf/templates/emailer/email.html | 2 +- .../modules/emailer/emailerissue.html | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/itf/static/js/insidepage.js b/itf/static/js/insidepage.js index a38bfc0..3c4de23 100755 --- a/itf/static/js/insidepage.js +++ b/itf/static/js/insidepage.js @@ -54,11 +54,30 @@ $('#listLeft ul li a').live("click", function() { // html = html.replace(searchTerm, "" + searchTerm + ""); } $('#bottomRight').html(html); + + postLoadQuery(); //parse query string params for post load actions // console.log(data); }); return false; }); +function postLoadQuery() { + if (queryData.hasOwnProperty("goto")) { + var locationHash = queryData['goto']; + var scrollTop = $('a[name=' + locationHash + ']').position().top; + $(document).scrollTop(scrollTop + 400); //FIXME!! + delete queryData['goto']; + } +/* + if (queryData.hasOwnProperty("btn")) { + var $btn = $('#' + queryData.btn); + $btn.click(); + console.log($btn); + delete queryData['btn']; + } +*/ +} + $('.lightboxNext').live("click", function(e) { var $i = $(this).data("image"); $i.click(); diff --git a/itf/templates/emailer/email.html b/itf/templates/emailer/email.html index 732b93e..26fdb0d 100755 --- a/itf/templates/emailer/email.html +++ b/itf/templates/emailer/email.html @@ -28,7 +28,7 @@