Disable #cc-sync in panel-grid when there's only one stem (nothing to sync; aspect is fixed by the dialog) and hide any .compare-controls label whose select is disabled via :has.
16 lines
532 B
JavaScript
16 lines
532 B
JavaScript
// compare.js — thin shim that parses ?stem=…&stem=… (legacy ?a=&b=) and
|
|
// hands off to panel-grid.js.
|
|
|
|
import { mountPanels } from './panel-grid.js?v=6';
|
|
|
|
const params = new URLSearchParams(window.location.search);
|
|
let stems = params.getAll('stem').filter(Boolean);
|
|
if (stems.length === 0) {
|
|
stems = [params.get('a') || '', params.get('b') || ''].filter(Boolean);
|
|
}
|
|
|
|
const host = document.getElementById('panel-host');
|
|
const controls = document.getElementById('compare-controls');
|
|
|
|
mountPanels({ host, controls, stems });
|