mirror of
https://ark.sudovanilla.org/Korbs/electron-tabs.git
synced 2024-12-22 19:43:53 +00:00
Support custom styles
This commit is contained in:
parent
d0df158fcf
commit
6a3cc4f7c6
|
@ -6,7 +6,14 @@
|
||||||
</head>
|
</head>
|
||||||
<body style="margin:0">
|
<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 src="../dist/electron-tabs.sortable.js"></script>
|
||||||
<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({
|
const shadow = this.attachShadow({
|
||||||
mode: "open"
|
mode: "open"
|
||||||
});
|
});
|
||||||
|
this.shadow = shadow;
|
||||||
const wrapper = document.createElement("div");
|
const wrapper = document.createElement("div");
|
||||||
wrapper.setAttribute("class", "etabs");
|
wrapper.setAttribute("class", "etabs");
|
||||||
const tabgroup = document.createElement("div");
|
const tabgroup = document.createElement("div");
|
||||||
|
@ -63,6 +64,13 @@ class $4fa36e821943b400$var$TabGroup extends HTMLElement {
|
||||||
}
|
}
|
||||||
this.emit("ready", this);
|
this.emit("ready", this);
|
||||||
}
|
}
|
||||||
|
connectedCallback() {
|
||||||
|
const style = this.querySelector("style");
|
||||||
|
if (style) {
|
||||||
|
const clone = style.cloneNode(this);
|
||||||
|
this.shadow.appendChild(clone);
|
||||||
|
}
|
||||||
|
}
|
||||||
setDefaultTab(tab) {
|
setDefaultTab(tab) {
|
||||||
this.options.defaultTab = 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({
|
const shadow = this.attachShadow({
|
||||||
mode: "open"
|
mode: "open"
|
||||||
});
|
});
|
||||||
|
this.shadow = shadow;
|
||||||
const wrapper = document.createElement("div");
|
const wrapper = document.createElement("div");
|
||||||
wrapper.setAttribute("class", "etabs");
|
wrapper.setAttribute("class", "etabs");
|
||||||
const tabgroup = document.createElement("div");
|
const tabgroup = document.createElement("div");
|
||||||
|
@ -3133,6 +3134,13 @@ class TabGroup extends HTMLElement {
|
||||||
}
|
}
|
||||||
this.emit("ready", this);
|
this.emit("ready", this);
|
||||||
}
|
}
|
||||||
|
connectedCallback() {
|
||||||
|
const style = this.querySelector("style");
|
||||||
|
if (style) {
|
||||||
|
const clone = style.cloneNode(this);
|
||||||
|
this.shadow.appendChild(clone);
|
||||||
|
}
|
||||||
|
}
|
||||||
setDefaultTab(tab) {
|
setDefaultTab(tab) {
|
||||||
this.options.defaultTab = 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
|
// Create custom element
|
||||||
const shadow = this.attachShadow({mode: "open"});
|
const shadow = this.attachShadow({mode: "open"});
|
||||||
|
this.shadow = shadow;
|
||||||
|
|
||||||
const wrapper = document.createElement("div");
|
const wrapper = document.createElement("div");
|
||||||
wrapper.setAttribute("class", "etabs");
|
wrapper.setAttribute("class", "etabs");
|
||||||
|
@ -77,6 +78,14 @@ class TabGroup extends HTMLElement {
|
||||||
this.emit("ready", this);
|
this.emit("ready", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connectedCallback () {
|
||||||
|
const style = this.querySelector("style");
|
||||||
|
if (style) {
|
||||||
|
const clone = style.cloneNode(this);
|
||||||
|
this.shadow.appendChild(clone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setDefaultTab (tab) {
|
setDefaultTab (tab) {
|
||||||
this.options.defaultTab = tab;
|
this.options.defaultTab = tab;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue