From f3072378556a9432455242e1a2989cde6a48f2c8 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Sat, 26 Jan 2019 18:08:06 +0100 Subject: [PATCH] "Open the tab defined in the URL" compatibility - Better compatibility by not using ``` - If page is scrollable, prevent jumping down past the tabs --- bl-kernel/admin/views/content.php | 10 +++++++--- bl-kernel/admin/views/settings.php | 11 ++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bl-kernel/admin/views/content.php b/bl-kernel/admin/views/content.php index fcf2f3f9..1587d933 100644 --- a/bl-kernel/admin/views/content.php +++ b/bl-kernel/admin/views/content.php @@ -85,7 +85,7 @@ function table($type) { $friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key(); echo ''.$friendlyURL.''; - echo ''.PHP_EOL; + echo ''.PHP_EOL; echo ' '.$L->g('Edit').''.PHP_EOL; if (count($page->children())==0) { echo ''.PHP_EOL; @@ -143,7 +143,7 @@ function table($type) { $friendlyURL = Text::isEmpty($url->filters('page')) ? '/'.$page->key() : '/'.$url->filters('page').'/'.$page->key(); echo ''.$friendlyURL.''; - echo ''.PHP_EOL; + echo ''.PHP_EOL; echo ' '.$L->g('Edit').''.PHP_EOL; if (count($page->children())==0) { echo ''.PHP_EOL; @@ -283,5 +283,9 @@ $(document).ready(function() { form.hide().appendTo("body").submit(); }); + + // Open the tab defined in the URL + $('a[href="'+ window.location.hash +'"]').tab('show'); + window.scrollTo(0); }); - + \ No newline at end of file diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php index ccf40219..9f8f96f7 100644 --- a/bl-kernel/admin/views/settings.php +++ b/bl-kernel/admin/views/settings.php @@ -345,6 +345,9 @@ } }); + // Open the tab defined in the URL + $('a[href="'+ window.location.hash +'"]').tab('show'); + window.scrollTo(0); }); @@ -536,10 +539,4 @@ - - - + \ No newline at end of file