From 8da612ce6a921e2f62777e2ec70f016f65eeb7db Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 16 Apr 2013 22:38:15 -0700 Subject: [PATCH] fixes #1250 --- app/assets/javascripts/utility.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/utility.js b/app/assets/javascripts/utility.js index fd0761649..e56b905d3 100644 --- a/app/assets/javascripts/utility.js +++ b/app/assets/javascripts/utility.js @@ -3,16 +3,22 @@ return $("meta[name=" + key + "]").attr("content"); } + Danbooru.scrolling = false; + Danbooru.scroll_to = function(element) { + if (Danbooru.scrolling) { + return; + } else { + Danbooru.scrolling = true; + } + var top = null; if (typeof(element) === "number") { top = element; } else { top = element.offset().top - 10; } - $('html, body').animate({ - scrollTop: top - }, 300); + $('html, body').animate({scrollTop: top}, 200, "linear", function() {Danbooru.scrolling = false;}); } Danbooru.notice = function(msg) {