プロジェクト

全般

プロフィール

Vote #73837

完了

Update URL when changing tab

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
70
issue_org_id:
13900
author_id:
1188
assigned_to_id:
1188
comments:
5
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Redmine tabs (in Settings or Administration for instance) are all loaded at once when the page is loaded. When changing tab, the URL is not updated, hence it breaks navigation in some minor ways, which I find annoying on a daily basis.. :

  • if the user reloads the page he's sent back to the default tab, not the one he was viewing
  • previous/next buttons behave counterintuitively : only the default tab remains in the history, and once you leave a tab, you never go back to it without having to re-click on the tab

The simplest solution to that is to use the History API introduced a couple years ago in most browsers, so that URL is updated whenever a click on a new tab occurs. Basically it boils down to this:


/* better handling of history in redmine tabs */
$(function() {
$(".tabs a").on("click", function() {
//only trigger history API if supported
if ("replaceState" in window.history) {
//replace current URL with the "href" attribute of the current link
window.history.replaceState(null, document.title, this.href);
}
})
})

Any opinion on that is welcome. If none I'll add it in the next few days, I think I'll integrate it directly in the @showTab()@ function.


journals

--------------------------------------------------------------------------------
Done in r11765
--------------------------------------------------------------------------------
Nice... Thanks.
--------------------------------------------------------------------------------
Excellent!
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン2.4.0_70 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0