Adding 'f' and 'u' keyboard shortcuts for fullscreen/sidebar. Also fixed the keyboard shortcuts modal to not wrap incorrectly on small screens.

This commit is contained in:
Samuel Clay 2011-02-23 18:09:09 -05:00
parent 3bdf5ed308
commit 87b5eac123
3 changed files with 23 additions and 3 deletions

View file

@ -2532,7 +2532,8 @@ a.NB-splash-link:hover {
}
.simplemodal-wrap {
overflow: auto;
overflow-y: auto;
overflow-x: hidden;
}
/* ====================== */
@ -4348,6 +4349,7 @@ background: transparent;
overflow: hidden;
background-color: #F0F0F0;
padding: 8px;
width: 570px;
}
.NB-modal-keyboard .NB-keyboard-shortcut {
width: 270px;

View file

@ -3366,6 +3366,7 @@
close_sidebar: function() {
this.$s.$body.layout().close('west');
this.resize_window();
this.flags['sidebar_closed'] = true;
$('.NB-taskbar-sidebar-toggle-open').stop().animate({
'left': -1
}, {
@ -3378,6 +3379,7 @@
open_sidebar: function() {
this.$s.$body.layout().open('west');
this.resize_window();
this.flags['sidebar_closed'] = false;
$('.NB-taskbar-sidebar-toggle-open').stop().css({
'left': -24
});
@ -5390,6 +5392,22 @@
e.preventDefault();
self.page_in_story(0.4, -1);
});
$document.bind('keydown', 'f', function(e) {
e.preventDefault();
if (self.flags['sidebar_closed']) {
self.open_sidebar();
} else {
self.close_sidebar();
}
});
$document.bind('keydown', 'u', function(e) {
e.preventDefault();
if (self.flags['sidebar_closed']) {
self.open_sidebar();
} else {
self.close_sidebar();
}
});
}
};

View file

@ -126,8 +126,8 @@ NEWSBLUR.ReaderKeyboard.prototype = {
var self = this;
this.$modal.modal({
'minWidth': 600,
'maxWidth': 600,
'minWidth': 620,
'maxWidth': 620,
'overlayClose': true,
'onOpen': function (dialog) {
dialog.overlay.fadeIn(200, function () {