mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 10:30:45 +08:00
This commit is contained in:
parent
75526007d7
commit
d4e3c1e660
@ -92,13 +92,13 @@ export class Dock {
|
|||||||
this.pin = !target.classList.contains("dock__item--pin");
|
this.pin = !target.classList.contains("dock__item--pin");
|
||||||
const hasActive = this.element.querySelector(".dock__item--active");
|
const hasActive = this.element.querySelector(".dock__item--active");
|
||||||
if (!this.pin) {
|
if (!this.pin) {
|
||||||
if (this.position === "Left" ) {
|
if (this.position === "Left") {
|
||||||
this.layout.element.setAttribute("style", `width:${this.layout.element.clientWidth}px;
|
this.layout.element.setAttribute("style", `width:${this.layout.element.clientWidth}px;
|
||||||
opacity: ${hasActive ? 1 : 0};
|
opacity: ${hasActive ? 1 : 0};
|
||||||
left:${this.element.clientWidth}px;
|
left:${this.element.clientWidth}px;
|
||||||
top: 112px;
|
top: 112px;
|
||||||
bottom: 82px;`);
|
bottom: 82px;`);
|
||||||
} else if ( this.position === "Right") {
|
} else if (this.position === "Right") {
|
||||||
this.layout.element.setAttribute("style", `width:${this.layout.element.clientWidth}px;
|
this.layout.element.setAttribute("style", `width:${this.layout.element.clientWidth}px;
|
||||||
opacity: ${hasActive ? 1 : 0};
|
opacity: ${hasActive ? 1 : 0};
|
||||||
"right":${this.element.clientWidth}px;
|
"right":${this.element.clientWidth}px;
|
||||||
@ -130,8 +130,8 @@ ${this.position === "Top" ? ("top:" + (this.element.offsetHeight + document.getE
|
|||||||
target = target.parentElement;
|
target = target.parentElement;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.layout.element.addEventListener("mouseleave", (event) => {
|
this.layout.element.addEventListener("mouseleave", (event: MouseEvent & { toElement: HTMLElement }) => {
|
||||||
if (this.pin) {
|
if (this.pin || event.toElement.classList.contains("b3-menu")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.position === "Left" && event.clientX < 43) {
|
if (this.position === "Left" && event.clientX < 43) {
|
||||||
@ -159,7 +159,7 @@ width:${this.layout.element.clientWidth}px;
|
|||||||
left:-${this.layout.element.clientWidth}px;
|
left:-${this.layout.element.clientWidth}px;
|
||||||
top:112px;
|
top:112px;
|
||||||
bottom: 82px;`);
|
bottom: 82px;`);
|
||||||
} else if ( this.position === "Right") {
|
} else if (this.position === "Right") {
|
||||||
this.layout.element.setAttribute("style", `opacity:0px;
|
this.layout.element.setAttribute("style", `opacity:0px;
|
||||||
width:${this.layout.element.clientWidth}px;
|
width:${this.layout.element.clientWidth}px;
|
||||||
right:-${this.layout.element.clientWidth}px;
|
right:-${this.layout.element.clientWidth}px;
|
||||||
|
Loading…
Reference in New Issue
Block a user