Support custom styles
This commit is contained in:
parent
d0df158fcf
commit
6a3cc4f7c6
6 changed files with 35 additions and 3 deletions
|
@ -6,7 +6,14 @@
|
|||
</head>
|
||||
<body style="margin:0">
|
||||
|
||||
<tab-group new-tab-button="true" sortable="true"></tab-group>
|
||||
<tab-group new-tab-button="true" sortable="true">
|
||||
<style>
|
||||
/* Add custom style */
|
||||
.etabs-tab:hover .etabs-tab-title {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
</tab-group>
|
||||
|
||||
<script src="../dist/electron-tabs.sortable.js"></script>
|
||||
<script>
|
||||
|
|
8
dist/electron-tabs.js
vendored
8
dist/electron-tabs.js
vendored
|
@ -23,6 +23,7 @@ class $4fa36e821943b400$var$TabGroup extends HTMLElement {
|
|||
const shadow = this.attachShadow({
|
||||
mode: "open"
|
||||
});
|
||||
this.shadow = shadow;
|
||||
const wrapper = document.createElement("div");
|
||||
wrapper.setAttribute("class", "etabs");
|
||||
const tabgroup = document.createElement("div");
|
||||
|
@ -63,6 +64,13 @@ class $4fa36e821943b400$var$TabGroup extends HTMLElement {
|
|||
}
|
||||
this.emit("ready", this);
|
||||
}
|
||||
connectedCallback() {
|
||||
const style = this.querySelector("style");
|
||||
if (style) {
|
||||
const clone = style.cloneNode(this);
|
||||
this.shadow.appendChild(clone);
|
||||
}
|
||||
}
|
||||
setDefaultTab(tab) {
|
||||
this.options.defaultTab = tab;
|
||||
}
|
||||
|
|
2
dist/electron-tabs.js.map
vendored
2
dist/electron-tabs.js.map
vendored
File diff suppressed because one or more lines are too long
8
dist/electron-tabs.sortable.js
vendored
8
dist/electron-tabs.sortable.js
vendored
|
@ -3093,6 +3093,7 @@ class TabGroup extends HTMLElement {
|
|||
const shadow = this.attachShadow({
|
||||
mode: "open"
|
||||
});
|
||||
this.shadow = shadow;
|
||||
const wrapper = document.createElement("div");
|
||||
wrapper.setAttribute("class", "etabs");
|
||||
const tabgroup = document.createElement("div");
|
||||
|
@ -3133,6 +3134,13 @@ class TabGroup extends HTMLElement {
|
|||
}
|
||||
this.emit("ready", this);
|
||||
}
|
||||
connectedCallback() {
|
||||
const style = this.querySelector("style");
|
||||
if (style) {
|
||||
const clone = style.cloneNode(this);
|
||||
this.shadow.appendChild(clone);
|
||||
}
|
||||
}
|
||||
setDefaultTab(tab) {
|
||||
this.options.defaultTab = tab;
|
||||
}
|
||||
|
|
2
dist/electron-tabs.sortable.js.map
vendored
2
dist/electron-tabs.sortable.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -22,6 +22,7 @@ class TabGroup extends HTMLElement {
|
|||
|
||||
// Create custom element
|
||||
const shadow = this.attachShadow({mode: "open"});
|
||||
this.shadow = shadow;
|
||||
|
||||
const wrapper = document.createElement("div");
|
||||
wrapper.setAttribute("class", "etabs");
|
||||
|
@ -77,6 +78,14 @@ class TabGroup extends HTMLElement {
|
|||
this.emit("ready", this);
|
||||
}
|
||||
|
||||
connectedCallback () {
|
||||
const style = this.querySelector("style");
|
||||
if (style) {
|
||||
const clone = style.cloneNode(this);
|
||||
this.shadow.appendChild(clone);
|
||||
}
|
||||
}
|
||||
|
||||
setDefaultTab (tab) {
|
||||
this.options.defaultTab = tab;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue