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 585ec6d0..0506e9c7 100644
--- a/lms/www/courses/index.js
+++ b/lms/www/courses/index.js
@@ -2,6 +2,14 @@
frappe.ready(() => {
generate_graph("New Signups");
generate_graph("Course Enrollments");
+
+ $(".nav-link").click((e) => {
+ change_hash(e);
+ });
+
+ if (window.location.hash) {
+ open_tab();
+ }
});
@@ -40,3 +48,13 @@ 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 da344e2a..fafa25ea 100644
--- a/lms/www/profiles/profile.js
+++ b/lms/www/profiles/profile.js
@@ -6,6 +6,14 @@ frappe.ready(() => {
save_role(e);
});
+ $(".nav-link").click((e) => {
+ change_hash(e);
+ });
+
+ if (window.location.hash) {
+ open_tab();
+ }
+
});
@@ -17,7 +25,7 @@ const make_profile_active_in_navbar = () => {
link_array.length && $(link_array[0]).addClass("active");
}, 0)
}
-}
+};
const save_role = (e) => {
@@ -39,4 +47,14 @@ const save_role = (e) => {
}
}
})
-}
+};
+
+
+const change_hash = (e) => {
+ window.location.hash = $(e.currentTarget).attr("href");
+};
+
+
+const open_tab = () => {
+ $(`a[href="${window.location.hash}"]`).click();
+};