Fixed collision between multipage and modal link event

This commit is contained in:
Øyvind Bakkeli committed 2011-07-22 14:15:24 +02:00
1 parent f508131a50
commit c579653877
2 files changed
+13 -6

No files matched your search

+11 -2
View File
@@ -66,7 +66,7 @@ function showUrlModal(href)
});
},
onClose: function (dialog) {
window.location = preModal;
setLocationWithoutScrolling(preModal);
dialog.data.slideUp('fast', function () {
dialog.overlay.slideUp('fast', function () {
dialog.container.fadeOut('fast', function () {
@@ -82,6 +82,14 @@ function showUrlModal(href)
}
function setLocationWithoutScrolling(location)
{
var from = $j("body").scrollTop();
if(!from) from = $j("html").scrollTop();
window.location = location;
$j("body,html").scrollTop(from);
}
var preModal = window.location.href + "#"
if(preModal.indexOf("#") == -1) preModal = preModal.substr(0, preModal.indexOf("#"));
@@ -99,8 +107,9 @@ $j(function()
var modal_not_match = Array(/wp-admin/);
$j("[href]").click(function(e)
$j(".content .post [href],#header [href]").live('click',function(e)
{
preModal = window.location.href;
for(var i = 0; i < modal_match.length; i++)
if(this.href.match(modal_match[i]))
break;