diff --git a/snipt/media/cache/snipt.js b/snipt/media/cache/snipt.js index 012d313..755155e 100644 --- a/snipt/media/cache/snipt.js +++ b/snipt/media/cache/snipt.js @@ -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'); diff --git a/snipt/media/js/src/modules/snipt.js b/snipt/media/js/src/modules/snipt.js index 727bed5..24b5a58 100644 --- a/snipt/media/js/src/modules/snipt.js +++ b/snipt/media/js/src/modules/snipt.js @@ -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');