Skip to content

Commit

Permalink
fix: Fixed dark-theme toggle not working in legacy pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdul Rehman authored and Abdul Rehman committed Feb 17, 2025
1 parent a1ae597 commit 2040296
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Bugfix] Fixed breaking dark theme toggle not working in legacy pages. (by @rehmansheikh222)
9 changes: 9 additions & 0 deletions tutorindigo/templates/indigo/lms/static/js/dark-theme.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
(function() {
if (window.INDIGO_DARK_THEME_INITIALIZED) {
console.log("dark-theme.js: script already initialized, skipping second run.");
return;
}
window.INDIGO_DARK_THEME_INITIALIZED = true;
// ========== END GUARD CHECK ===============

$(document).ready(function() {
'use strict';

Expand Down Expand Up @@ -36,3 +44,4 @@ $(document).ready(function() {

$('#toggle-switch').on('change', toggleTheme);
});
})();

0 comments on commit 2040296

Please sign in to comment.