Add glimpse option to query panel (fixes #273)

Change-Id: Ibe89e546053051908f0661a4fe1b72c082c87e8c
diff --git a/Changes b/Changes
index 6271454..c9fafb2 100644
--- a/Changes
+++ b/Changes
@@ -5,6 +5,7 @@
         - Support API version 1.1 (diewald)
         - Support title change in button groups (diewald)
         - Eliminates authorized_only (deprecation in API version 1.1)
+        - Add 'glimpse' option to query panel (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 0eca1b7..7f7694b 100644
--- a/dev/js/src/panel/query.js
+++ b/dev/js/src/panel/query.js
@@ -6,8 +6,9 @@
 "use strict";
 
 define([
-  'panel'
-], function (panelClass) {
+  'panel',
+  'state'
+], function (panelClass, stateClass) {
 
   const d = document;
 
@@ -25,6 +26,31 @@
     _init : function (opened) {
       this._opened = opened;
       const a = this.actions();
+
+      // 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;
+        }
+      };
+      s.associate(glimpseChange);
+      s.set(cof.checked);
+      
+      a.addToggle(
+        "Glimpse", {
+          'cls':['glimpse'],
+          'desc':colabel.getAttribute('title')
+        },
+        s
+      );
+
+      // Don't show default glimpse
+      colabel.style.display = "none";
+
       
       // If plugins are enabled, add all buttons for the query panel
       if (KorAP.Plugin) {
diff --git a/dev/js/src/tour/tours.js b/dev/js/src/tour/tours.js
index 9490780..8b10b7e 100644
--- a/dev/js/src/tour/tours.js
+++ b/dev/js/src/tour/tours.js
@@ -197,7 +197,7 @@
         },  
         {
           title: loc.TOUR_glimpseti,
-          element: doe.querySelector('#glimpse').parentNode,
+          element: doe.querySelector('.glimpse'),
           intro: loc.TOUR_glimpse,
           position: "bottom",
         }, 
diff --git a/dev/scss/header/searchbar.scss b/dev/scss/header/searchbar.scss
index 19fcaf8..4ce0b12 100644
--- a/dev/scss/header/searchbar.scss
+++ b/dev/scss/header/searchbar.scss
@@ -49,6 +49,7 @@
 
 .query.panel {
   padding-right: lengths.$button-width;
+  height: auto;
 }
 
 // Specify result button group layout
@@ -59,8 +60,11 @@
   text-align:     right;
   vertical-align: top;
   line-height:    1.3em;
+  height:0;
 
   > span {
+    position: relative;
     box-shadow: none;
+    z-index: 10;
   }
 }
diff --git a/dev/scss/header/vc.scss b/dev/scss/header/vc.scss
index a8acb09..50f54e7 100644
--- a/dev/scss/header/vc.scss
+++ b/dev/scss/header/vc.scss
@@ -404,7 +404,7 @@
 
   > div.vc {
     display:          none;
-    margin:           1.3em 0 .5em 0;
+    margin:           2em 0 .5em 0;
     border:           2px solid colors.$dark-green;
     background-color: colors.$nearly-white;