Scroll to top/bottom keys
parent
9fef91aadd
commit
fee48a2663
|
@ -1052,9 +1052,7 @@ jQuery(function($) {
|
|||
|
||||
if (fromClick !== true) {
|
||||
if (SniptList.$snipts.index(this.$el) === 0) {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 0);
|
||||
window.scrollTo(0, 0);
|
||||
} else {
|
||||
$('html, body').animate({
|
||||
scrollTop: this.$el.offset().top - 50
|
||||
|
@ -1101,6 +1099,18 @@ jQuery(function($) {
|
|||
$selected.trigger('deselect');
|
||||
}
|
||||
});
|
||||
$document.bind('keydown', 'g', function() {
|
||||
if (window.$selected) {
|
||||
window.$selected.trigger('deselect');
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
$document.bind('keydown', 'Shift+g', function() {
|
||||
if (window.$selected) {
|
||||
window.$selected.trigger('deselect');
|
||||
}
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
});
|
||||
$document.bind('keydown', 'j', function() {
|
||||
if (!$selected) {
|
||||
SniptList.$snipts.eq(0).trigger('select');
|
||||
|
|
|
@ -80,9 +80,7 @@
|
|||
|
||||
if (fromClick !== true) {
|
||||
if (SniptList.$snipts.index(this.$el) === 0) {
|
||||
$('html, body').animate({
|
||||
scrollTop: 0
|
||||
}, 0);
|
||||
window.scrollTo(0, 0);
|
||||
} else {
|
||||
$('html, body').animate({
|
||||
scrollTop: this.$el.offset().top - 50
|
||||
|
@ -129,6 +127,18 @@
|
|||
$selected.trigger('deselect');
|
||||
}
|
||||
});
|
||||
$document.bind('keydown', 'g', function() {
|
||||
if (window.$selected) {
|
||||
window.$selected.trigger('deselect');
|
||||
}
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
$document.bind('keydown', 'Shift+g', function() {
|
||||
if (window.$selected) {
|
||||
window.$selected.trigger('deselect');
|
||||
}
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
});
|
||||
$document.bind('keydown', 'j', function() {
|
||||
if (!$selected) {
|
||||
SniptList.$snipts.eq(0).trigger('select');
|
||||
|
|
Loading…
Reference in New Issue