Fix test suite for glimpse button rearrangement

Change-Id: Ie289423714573db82b1fda2e5684eb8056870fb8
diff --git a/Changes b/Changes
index c9fafb2..3a33bbc 100644
--- a/Changes
+++ b/Changes
@@ -6,6 +6,7 @@
         - Support title change in button groups (diewald)
         - Eliminates authorized_only (deprecation in API version 1.1)
         - Add 'glimpse' option to query panel (diewald)
+        - Fix test suite for glimpse-rearrangement (diewald)
 
 0.64 2026-02-14
         - Improve 'Plugins' mounting (diewald)
diff --git a/dev/js/src/panel/query.js b/dev/js/src/panel/query.js
index 7f7694b..08f51d3 100644
--- a/dev/js/src/panel/query.js
+++ b/dev/js/src/panel/query.js
@@ -27,11 +27,34 @@
       this._opened = opened;
       const a = this.actions();
 
+
+      // If plugins are enabled, add all buttons for the query panel
+      if (KorAP.Plugin) {
+
+        // Add all matchbuttons in order
+        KorAP.Plugin
+          .buttonGroup("query")
+          .forEach(i => a.add.apply(a, i));
+
+        KorAP.Plugin.clearButtonGroup("query")
+      };
+      
+      let colabel = document.getElementById("glimpse");
+
+      if (colabel == undefined) {
+	return this;
+      }
+      
+      colabel = colabel.parentNode;
+
+      if (colabel == undefined) {
+	return this;
+      };
+      
       // Add glimpse button
       const s = stateClass.create([true,false]);
       const cof = document.getElementById("q-cutoff-field");
-      const colabel = document.getElementById("glimpse").parentNode;
-     
+    
       let glimpseChange = {
         setState : function (val) {
           cof.checked = val;
@@ -47,22 +70,10 @@
         },
         s
       );
-
+      
       // Don't show default glimpse
       colabel.style.display = "none";
-
-      
-      // If plugins are enabled, add all buttons for the query panel
-      if (KorAP.Plugin) {
-
-        // Add all matchbuttons in order
-        KorAP.Plugin
-          .buttonGroup("query")
-          .forEach(i => a.add.apply(a, i));
-
-        KorAP.Plugin.clearButtonGroup("query")
-      };
-      
+     
       return this;
     }
   }