From ea916587ecd8ccae71645fecae2ba0f08ed54c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Bakkeli?= Date: Sun, 31 Jul 2011 19:04:09 +0200 Subject: [PATCH] =?UTF-8?q?Fikset=20s=C3=A5=20lightbox=20vises=20n=C3=A5r?= =?UTF-8?q?=20man=20trykker=20p=C3=A5=20posten,=20ikke=20bare=20lenka?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front-page.php | 3 +++ header.php | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/front-page.php b/front-page.php index a11e353..d618f58 100755 --- a/front-page.php +++ b/front-page.php @@ -61,8 +61,11 @@ foreach($items as $item) if($query) { $id = strtolower(preg_replace('#[^\w]+#', '', $item->title)); + echo "
"; + if($pre) echo $pre; + query_posts($query); get_template_part( 'loop', $loop); diff --git a/header.php b/header.php index 3a8f4d3..e4cf8fa 100755 --- a/header.php +++ b/header.php @@ -109,20 +109,27 @@ $j(function() var modal_not_match = Array(/wp-admin/); -$j(".content .post [href],#header [href]").live('click',function(e) +$j(".content .post,#header [href]").live('click',function(e) { preModal = window.location.href; + e.preventDefault(); + + if($j(this).attr('href')) + href = this.href; + else + href = $j(this).find("[href]").attr('href'); + for(var i = 0; i < modal_match.length; i++) - if(this.href.match(modal_match[i])) + if(href.match(modal_match[i])) break; if(i == modal_match.length) return; for(var i = 0; i < modal_not_match.length; i++) - if(this.href.match(modal_not_match[i])) + if(href.match(modal_not_match[i])) return; - showUrlModal(this.href); - e.preventDefault(); + showUrlModal(href); + var href = this.href.substr(); window.location = window.location.href.split("#")[0] + "#" + href; });