use jQuery instead of JS + change spacing to tabs
this should fix IE/browser problems (see: #349)
This commit is contained in:
parent
5df6c09da6
commit
fe6b83412f
@ -31,20 +31,14 @@ class ArrowkeyNavigation extends Extension {
|
|||||||
global $page;
|
global $page;
|
||||||
|
|
||||||
$page->add_html_header("<script type=\"text/javascript\">
|
$page->add_html_header("<script type=\"text/javascript\">
|
||||||
document.onkeyup=checkKeycode;
|
(function($){
|
||||||
function checkKeycode(e)
|
$(document).keyup(function(e) {
|
||||||
{
|
if($(e.target).is('input', 'textarea')){ return; }
|
||||||
var keycode;
|
if (e.keyCode == 37) { window.location.href = '{$prev_url}'; }
|
||||||
if(window.event) keycode=window.event.keyCode;
|
else if (e.keyCode == 39) { window.location.href = '{$next_url}'; }
|
||||||
else if(e) keycode=e.which;
|
});
|
||||||
|
})(jQuery);
|
||||||
if (e.srcElement.tagName != \"INPUT\")
|
</script>", 60);
|
||||||
{
|
|
||||||
if(keycode==\"37\") window.location.href='$prev_url';
|
|
||||||
else if(keycode==\"39\") window.location.href='$next_url';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# returns info about the current page number
|
# returns info about the current page number
|
||||||
@ -61,7 +55,6 @@ class ArrowkeyNavigation extends Extension {
|
|||||||
$total_pages = ceil($database->get_one(
|
$total_pages = ceil($database->get_one(
|
||||||
"SELECT COUNT(*) FROM images") / $images_per_page);
|
"SELECT COUNT(*) FROM images") / $images_per_page);
|
||||||
}
|
}
|
||||||
|
|
||||||
else { // if there are tags, use pages with tags
|
else { // if there are tags, use pages with tags
|
||||||
$prefix = $event->get_arg(0)."/";
|
$prefix = $event->get_arg(0)."/";
|
||||||
$page_number = (int)$event->get_arg(1);
|
$page_number = (int)$event->get_arg(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user