Skip to content

Commit 08c7275

Browse files
committed
Clean up presentation positioning
1 parent fd12537 commit 08c7275

File tree

9 files changed

+25
-29
lines changed

9 files changed

+25
-29
lines changed

css/_igv-generic-dialog-container.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ $igv-button-width: 75px;
3333
.igv-generic-dialog-container {
3434

3535
position: absolute;
36-
top: 0;
37-
left:0;
36+
37+
top: 50%;
38+
left: 50%;
39+
transform: translate(-50%, -50%);
40+
3841
width:300px;
3942
height:200px;
4043

css/_igv-ui-generic-dialog-container.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
box-sizing: content-box;
66

7-
position: fixed;
8-
top: 0;
9-
left:0;
7+
position: absolute;
8+
9+
top: 50%;
10+
left: 50%;
11+
transform: translate(-50%, -50%);
12+
1013
width:300px;
1114
height:fit-content;
1215
padding-bottom: 16px;

css/igv.css

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/cnvpytor/cnvpytorTrack.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import TrackBase from "../trackBase.js"
2-
import MenuUtils from "../ui/menuUtils.js"
32
import HDF5IndexedReader from "./HDF5IndexedReader.js"
43
import {CNVpytorVCF} from "./cnvpytorVCF.js"
54
import FeatureSource from '../feature/featureSource.js'

js/embedCss.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/gcnv/gcnvTrack.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import TrackBase from "../trackBase.js"
33
import IGVGraphics from "../igv-canvas.js"
44
import {isSimpleType} from "../util/igvUtils.js"
55
import paintAxis from "../util/paintAxis.js"
6-
import MenuUtils from "../ui/menuUtils.js"
76
import {StringUtils} from "../../node_modules/igv-utils/src/index.js"
87

98
const X_PIXEL_DIFF_THRESHOLD = 1

js/ui/components/inputDialog.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ class InputDialog {
1313
this.container = DOMUtils.div({class: 'igv-ui-generic-dialog-container'})
1414
parent.appendChild(this.container)
1515

16-
// const { x, y, width, height } = this.container.getBoundingClientRect();
17-
// console.log(`InputDialog - x ${ x } y ${ y } width ${ width } height ${ height }`)
18-
1916
// dialog header
2017
const header = DOMUtils.div({class: 'igv-ui-generic-dialog-header'})
2118
this.container.appendChild(header)
@@ -87,7 +84,12 @@ class InputDialog {
8784
return DOMPurify.sanitize(this._input.value)
8885
}
8986

90-
present(options, e) {
87+
88+
present(parent) {
89+
this.container.style.display = 'flex';
90+
}
91+
92+
__present(options, e) {
9193

9294
this.label.textContent = options.label
9395
this._input.value = options.value

js/ui/dataRangeDialog.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ class DataRangeDialog {
1212
this.container.className = 'igv-generic-dialog-container';
1313
parent.appendChild(this.container);
1414

15-
this.container.style.left = '0px';
16-
this.container.style.top = '0px';
17-
1815
// Create dialog header
1916
const header = document.createElement('div');
2017
header.className = 'igv-generic-dialog-header';
@@ -23,8 +20,6 @@ class DataRangeDialog {
2320
attachDialogCloseHandlerWithParent(header, () => {
2421
this.minimumInput.value = '';
2522
this.maximumInput.value = '';
26-
this.container.style.left = '0px';
27-
this.container.style.top = '0px';
2823
this.container.style.display = 'none';
2924
})
3025

@@ -162,12 +157,6 @@ class DataRangeDialog {
162157
}
163158

164159
present(parent) {
165-
const parentRect = parent.getBoundingClientRect();
166-
const bodyScrollTop = document.body.scrollTop || document.documentElement.scrollTop;
167-
168-
// Position the container
169-
this.container.style.left = `${parent.offsetWidth - this.container.offsetWidth}px`;
170-
this.container.style.top = `${parentRect.top + bodyScrollTop}px`;
171160
this.container.style.display = 'flex';
172161
}
173162

js/ui/multiTrackSelectButton.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import NavbarButton from "./navbarButton.js"
22
import {multiSelectImage, multiSelectImageHover} from "./navbarIcons/multiSelect.js"
33
import {buttonLabel} from "./navbarIcons/buttonLabel.js"
4-
import {multiTrackSelectExclusionTypes} from './menuUtils.js'
54

65
class MultiTrackSelectButton extends NavbarButton {
76

0 commit comments

Comments
 (0)