Commit f48c000a authored by Florian Pritz's avatar Florian Pritz
Browse files

Improve colorbox navigation and document it



- Make buttons fixed so you don't have to move the mouse
- Support h/l for vimperator users
- Document mappings so users actually know about them
Signed-off-by: default avatarFlorian Pritz <bluewind@xinu.at>
parent 2bc6b974
......@@ -29,7 +29,7 @@
.cboxPhoto{float:left !important; background: #fff;}
#cboxLoadingGraphic{background:url(/data/img/colorbox/loading.gif) no-repeat center center;}
#cboxLoadingOverlay{background:#000;}
#cboxTitle{position:absolute; top:-22px; left:0; color:#000;}
#cboxTitle{position:fixed; top:0; right:66px; color:#fff;}
#cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px; display: none;}
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
......@@ -42,8 +42,8 @@
overflow:visible;
width:20px;
height:20px;
position:absolute;
top:-20px;
position:fixed;
top:0;
background: transparent;
color: #fff;
}
......
......@@ -30,6 +30,7 @@ define(['jquery', 'underscore', 'jquery.colorbox'], function ($, _) {
retinaImage: true,
maxHeight: "100%",
maxWidth: "100%",
title: 'Use h/l or right/left arrow keys or these buttons:',
next: '<span class="glyphicon glyphicon-chevron-right"></span>',
previous: '<span class="glyphicon glyphicon-chevron-left"></span>',
close: '<span class="glyphicon glyphicon-remove"></span>',
......
......@@ -526,10 +526,10 @@
publicMethod.close();
}
if (open && settings.get('arrowKey') && $related[1] && !e.altKey) {
if (key === 37) {
if (key === 37 || key == 72) {
e.preventDefault();
$prev.click();
} else if (key === 39) {
} else if (key === 39 || key === 76) {
e.preventDefault();
$next.click();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment