[#181] position rigt hand side icons in status_bar so the dropups are usable on mobile devices

This commit is contained in:
Robin Scholtes 2023-05-09 18:14:15 +12:00
parent ee9ea051d1
commit 793acb54de
2 changed files with 12 additions and 8 deletions

View file

@ -45,6 +45,7 @@ class StatusBarPanel {
dom.setAttribute("data-help", `This status bar provides information about data in the ${this.label}. Help topics are available for each of the components by activating help when hovering over them.`);
lhs.innerHTML = this.constructLHS();
rhs.innerHTML = this.constructRHS();
rhs.classList.add("rhs");
dom.appendChild(lhs);
dom.appendChild(rhs);
@ -288,9 +289,10 @@ class StatusBarPanel {
*/
updateSizing(view) {
const viewHeight = view.contentDOM.parentNode.clientHeight;
this.dom.querySelectorAll(".cm-status-bar-select-scroll").forEach(
el => {
el.style.maxHeight = (viewHeight - 50) + "px";
el.style.maxHeight = window.innerWidth >= 768 ? (viewHeight - 50) + "px" : '250px';
}
);
}
@ -474,7 +476,7 @@ function makePanel(opts) {
sbPanel.updateSelection(update.state, update.selectionSet);
sbPanel.updateTiming();
sbPanel.monitorHTMLOutput();
if (update.geometryChanged) {
if ( update.geometryChanged) {
sbPanel.updateSizing(update.view);
}
if (update.docChanged) {