From 343fad85d9012832d6baeeaff33e8285665087e7 Mon Sep 17 00:00:00 2001 From: R De Groot - pastorius Date: Thu, 25 Feb 2021 13:02:21 +0100 Subject: [PATCH] Add offset to deeplink smudge as described in #12203 --- js/foundation.tabs.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/foundation.tabs.js b/js/foundation.tabs.js index ffc6a0c4a..88e12dc57 100644 --- a/js/foundation.tabs.js +++ b/js/foundation.tabs.js @@ -132,7 +132,7 @@ class Tabs extends Plugin { // Roll up a little to show the titles if (this.options.deepLinkSmudge) { var offset = this.$element.offset(); - $('html, body').animate({ scrollTop: offset.top }, this.options.deepLinkSmudgeDelay); + $('html, body').animate({ scrollTop: offset.top - this.options.deepLinkSmudgeOffset}, this.options.deepLinkSmudgeDelay); } /** @@ -464,6 +464,14 @@ Tabs.defaults = { */ deepLinkSmudgeDelay: 300, + /** + * If `deepLinkSmudge` is enabled, animation offset from the top for the deep link adjustment + * @option + * @type {number} + * @default 0 + */ + deepLinkSmudgeOffset: 0, + /** * If `deepLink` is enabled, update the browser history with the open tab * @option -- 2.47.2