File tree Expand file tree Collapse file tree 4 files changed +23
-6
lines changed
Expand file tree Collapse file tree 4 files changed +23
-6
lines changed Original file line number Diff line number Diff line change 5050 gap : 0.5ch ;
5151 overflow-x : auto ;
5252 background-color : var (--bg-color );
53- z-index : 19 ;
5453 }
5554
5655 .bottombar {
117116 import { State , Sheet } from " ./classes.svelte.js" ;
118117 import { compressText } from " ./compress.js" ;
119118 import { evalDebounced , functions } from " ./formula-functions.svelte.js" ;
120- import { debounce , replaceValues } from " ./helpers.js" ;
119+ import { debounce , replaceValues , nextZIndex } from " ./helpers.js" ;
121120 import { actions , keyboardHandler , keybindings } from " ./keyboard.js" ;
122121
123122 let { urlData } = $props ();
292291 bind: innerHeight
293292/ >
294293
294+ <!-- TODO : Better heuristic that doesn' t trigger on touchscreen laptops -->
295295{#if navigator.maxTouchPoints <= 1}
296296 <!-- Else float the bar above the virtual keyboard -->
297297 <div>
442442 < div class = " keyboardbar" style: top= " calc({visualBottom}px - 2.5em * 2)" >
443443 < FormulaBar bind: globals bind: editor= {globals .elements .formulaBar } / >
444444 {#if showInputButtons}
445- <div class="buttonbar">
445+ < div class = " buttonbar" style : z - index = { nextZIndex ()} >
446446 {@render insertTextButton (" =" )}
447447 {@render insertTextButton (" (" )}
448448 {@render insertTextButton (" )" )}
471471 < div
472472 class = " startmenu"
473473 bind: offsetHeight= {startHeight}
474+ style: z- index= {nextZIndex ()}
474475 style: -- height= " {startHeight}px"
475476 >
476477 {@render builder ([
Original file line number Diff line number Diff line change 3737<style >
3838 .menu {
3939 position : absolute ;
40- z-index : 20 ;
4140 background : none ;
4241 /* TODO: Keep? Adjust? */
4342 width : 300px ;
4746
4847<script >
4948 import ShyMenu from " ./ShyMenu.svelte" ;
50-
49+ import { nextZIndex } from " ./helpers.js " ;
5150 import { tick } from " svelte" ;
5251
5352 const {
9392 class =" menu"
9493 style:left =" {menuX }px"
9594 style:top =" {menuY }px"
95+ style:z-index ={nextZIndex ()}
9696 bind:offsetWidth ={menuWidth }
9797 bind:offsetHeight ={menuHeight }
9898 >
Original file line number Diff line number Diff line change 8585
8686<script >
8787 import Button from " ./Button.svelte" ;
88- import { randomId } from " ./helpers.js" ;
88+ import { randomId , nextZIndex } from " ./helpers.js" ;
8989
9090 const minDimension = Math .min (window .innerWidth , window .innerHeight );
9191
102102 let pointerStart = $state ();
103103 let dragging = $state (false );
104104
105+ let zindex = $state (nextZIndex ());
106+ $effect (() => {
107+ if (open) {
108+ zindex = nextZIndex ();
109+ }
110+ });
111+
105112 // If the dots pattern is redeclared (when there are multiple <Dialog>
106113 // components, for example), and the first one is inside of a `display:
107114 // none` element, then they will not render. Giving each a unique ID
168175 style: left= " max(0px, {left}px)"
169176 style: -- width= " min(calc(100% - {left}px), {width}px)"
170177 style: -- height= " min(calc(100% - {top}px), {height}px)"
178+ style: z- index= {zindex}
179+ onpointerdown= {() => (zindex = nextZIndex ())}
171180>
172181 < div class = " top" >
173182 < svg class = " drag" onpointerdown= {topPointerDown} onpointerup= {topPointerUp}>
Original file line number Diff line number Diff line change @@ -74,3 +74,10 @@ export function replaceValues(k, v) {
7474 // TODO: Do other things to make the data URL smaller
7575 return v ;
7676}
77+
78+ let nextIndex = 10 ;
79+ export function nextZIndex ( increment = 1 ) {
80+ const result = nextIndex ;
81+ nextIndex += increment ;
82+ return result ;
83+ }
You can’t perform that action at this time.
0 commit comments