From 5ece9fe99a6ce159a94acb3d95ec93dc0d878e8c Mon Sep 17 00:00:00 2001 From: albert Date: Sat, 2 Mar 2013 19:15:53 -0500 Subject: [PATCH] add js for scrolling to error/notice --- app/assets/javascripts/utility.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/javascripts/utility.js b/app/assets/javascripts/utility.js index f52a0edb3..e5fd5dd85 100644 --- a/app/assets/javascripts/utility.js +++ b/app/assets/javascripts/utility.js @@ -5,10 +5,18 @@ Danbooru.notice = function(msg) { $('#notice').html(msg).addClass("ui-state-highlight").removeClass("ui-state-error").fadeIn("fast"); + var scroll_top = $("#notice"); + $('html, body').animate({ + scrollTop: scroll_top + }, 250); } Danbooru.error = function(msg) { $('#notice').html(msg).removeClass("ui-state-highlight").addClass("ui-state-error").fadeIn("fast"); + var scroll_top = $("#notice"); + $('html, body').animate({ + scrollTop: scroll_top + }, 250); } Danbooru.is_subset = function(array, subarray) {