From 3186e8c7c7e897720dea080dec07413488cbd3bc Mon Sep 17 00:00:00 2001 From: Jennifer Chen Date: Fri, 21 May 2021 17:16:03 -0700 Subject: [PATCH] Fixed "top" link position and added behavior to go to top --- src/js/widgets/library_list/widget.js | 10 ++++++++++ .../list_of_things/templates/pagination-partial.html | 2 +- src/styles/sass/ads-sass/any-page.scss | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/js/widgets/library_list/widget.js b/src/js/widgets/library_list/widget.js index a71a16201..da1b67c71 100644 --- a/src/js/widgets/library_list/widget.js +++ b/src/js/widgets/library_list/widget.js @@ -100,6 +100,7 @@ define([ 'click #bulk-delete': 'bulkDelete', 'click #bulk-limit': 'bulkLimit', 'click #select-all-docs-cb': 'toggleAll', + 'click #backToTopBtn': 'goToTop', }, modelEvents: { @@ -113,6 +114,15 @@ define([ this.trigger('changeSort'); }, + goToTop: function() { + $(document.documentElement).animate( + { + scrollTop: 0, + }, + 'fast' + ); + }, + childViewOptions: function() { if (this.model.get('editRecords')) { return { permission: true }; diff --git a/src/js/widgets/list_of_things/templates/pagination-partial.html b/src/js/widgets/list_of_things/templates/pagination-partial.html index c6ed64860..10345890c 100644 --- a/src/js/widgets/list_of_things/templates/pagination-partial.html +++ b/src/js/widgets/list_of_things/templates/pagination-partial.html @@ -7,7 +7,7 @@ {{#unless query}} {{#unless error}} -
+
{{#if pageData}}
diff --git a/src/styles/sass/ads-sass/any-page.scss b/src/styles/sass/ads-sass/any-page.scss index 8d4bd686a..3f22b0b9d 100644 --- a/src/styles/sass/ads-sass/any-page.scss +++ b/src/styles/sass/ads-sass/any-page.scss @@ -91,6 +91,6 @@ div[data-widget='AlertsWidget'] { #backToTopBtn { position: absolute; - right: 2px; - bottom: 2px; + right: 0; + bottom: 0; }