diff --git a/lms/www/courses/index.html b/lms/www/courses/index.html
index 85a55751..b05d8e05 100644
--- a/lms/www/courses/index.html
+++ b/lms/www/courses/index.html
@@ -33,12 +33,19 @@
{{ _("All Courses") }}
- {% if show_creators_section %}
- {% endif %}
-
diff --git a/lms/www/courses/index.js b/lms/www/courses/index.js
index d5319a4b..7bcac6a2 100644
--- a/lms/www/courses/index.js
+++ b/lms/www/courses/index.js
@@ -1,6 +1,14 @@
frappe.ready(() => {
generate_graph("New Signups");
generate_graph("Course Enrollments");
+
+ $(".nav-link").click((e) => {
+ change_hash(e);
+ });
+
+ if (window.location.hash) {
+ open_tab();
+ }
});
const generate_graph = (chart_name) => {
@@ -40,3 +48,11 @@ const render_chart = (data, chart_name) => {
},
});
};
+
+const change_hash = (e) => {
+ window.location.hash = $(e.currentTarget).attr("href");
+};
+
+const open_tab = () => {
+ $(`a[href="${window.location.hash}"]`).click();
+};
diff --git a/lms/www/profiles/profile.js b/lms/www/profiles/profile.js
index 102200a8..62d07093 100644
--- a/lms/www/profiles/profile.js
+++ b/lms/www/profiles/profile.js
@@ -4,6 +4,14 @@ frappe.ready(() => {
$(".role").change((e) => {
save_role(e);
});
+
+ $(".nav-link").click((e) => {
+ change_hash(e);
+ });
+
+ if (window.location.hash) {
+ open_tab();
+ }
});
const make_profile_active_in_navbar = () => {
@@ -38,3 +46,11 @@ const save_role = (e) => {
},
});
};
+
+const change_hash = (e) => {
+ window.location.hash = $(e.currentTarget).attr("href");
+};
+
+const open_tab = () => {
+ $(`a[href="${window.location.hash}"]`).click();
+};