Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions src/Core.Assets/src/SplitPanels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
return element.dispatchEvent(event);
}

const styleSheet = new CSSStyleSheet();
styleSheet.replaceSync(`
const styleString = `
:host{ display: grid; }
:host([resizing]){ user-select: none; }
:host([resizing][direction=row]){ cursor: col-resize; }
Expand Down Expand Up @@ -37,7 +36,7 @@ styleSheet.replaceSync(`
:host([collapsed]) #slot2 { display: none; }

:host([no-barhandle]) #median span[part="handle"] { display: none; }
`);
`;

const template = `
<slot id="slot1" name="1"></slot>
Expand Down Expand Up @@ -77,9 +76,19 @@ class SplitPanels extends HTMLElement {
element.resizeDrag = element.resizeDrag.bind(element);
}
render() {
const shadow = this.attachShadow({ mode: "open" });
shadow.adoptedStyleSheets.push(styleSheet);
shadow.innerHTML = template;
if (document.adoptedStyleSheets) {
const shadow = this.attachShadow({ mode: "open" });
const styleSheet = new CSSStyleSheet();
styleSheet.replaceSync(styleString);
shadow.adoptedStyleSheets.push(styleSheet);
shadow.innerHTML = template;
}
else {
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = styleString;
document.getElementsByTagName('head')[0].appendChild(style);
}

this.updateBarSizeStyle();
}
Expand Down