File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 33 * @function
44 * @global
55 */
6- $ ( document ) . ready ( function ( ) {
6+ $ ( document ) . ready ( function ( ) {
77 /**
88 * The user's selected mode, stored in local storage.
99 * @type {string }
@@ -29,6 +29,11 @@ $(document).ready(function() {
2929 */
3030 var modeText = document . getElementById ( "modeText" ) ;
3131
32+ // Defensive: avoid crashing if expected DOM nodes are missing.
33+ if ( ! modeIcon || ! modeText ) {
34+ return ;
35+ }
36+
3237 // Set the mode icon and tooltip based on the user's selected mode.
3338 if ( mode === null || mode === "true" ) {
3439 modeIcon . innerHTML = "star_border" ;
@@ -45,6 +50,6 @@ $(document).ready(function() {
4550 $ ( ".materialize-iso, .dropdown-trigger" ) . dropdown ( {
4651 constrainWidth : false ,
4752 hover : false , // Activate on click
48- belowOrigin : true , // Displays dropdown below the button
53+ belowOrigin : true // Displays dropdown below the button
4954 } ) ;
5055} ) ;
You can’t perform that action at this time.
0 commit comments