mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-04 14:27:29 +08:00
Various color picker fixes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { html } from "lit"
|
||||
import Configuration from "../Configuration"
|
||||
import IDraggablePositionedTemplate from "./IDraggablePositionedTemplate"
|
||||
import MouseClickAction from "../input/mouse/MouseClickAction"
|
||||
import MouseMoveDraggable from "../input/mouse/MouseMoveDraggable"
|
||||
|
||||
/** @typedef {import("../element/WindowElement").default} WindowElement */
|
||||
@@ -23,22 +23,12 @@ export default class WindowTemplate extends IDraggablePositionedTemplate {
|
||||
})
|
||||
}
|
||||
|
||||
createInputObjects() {
|
||||
return [
|
||||
...super.createInputObjects(),
|
||||
new MouseClickAction(this.element.querySelector(".ueb-window-close"), this.element.blueprint, {},
|
||||
undefined,
|
||||
() => this.element.remove()
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<div class="ueb-window">
|
||||
<div class="ueb-window-top">
|
||||
<div class="ueb-window-name ueb-ellipsis-nowrap-text">${this.renderWindowName()}</div>
|
||||
<div class="ueb-window-close">
|
||||
<div class="ueb-window-close" @click="${() => this.element.remove()}">
|
||||
<svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<line x1="2" y1="2" x2="30" y2="30" stroke="currentColor" stroke-width="4" />
|
||||
<line x1="30" y1="2" x2="2" y2="30" stroke="currentColor" stroke-width="4" />
|
||||
@@ -59,4 +49,14 @@ export default class WindowTemplate extends IDraggablePositionedTemplate {
|
||||
renderContent() {
|
||||
return html``
|
||||
}
|
||||
|
||||
apply() {
|
||||
this.element.dispatchEvent(new CustomEvent(Configuration.windowApplyEventName))
|
||||
this.element.remove()
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this.element.dispatchEvent(new CustomEvent(Configuration.windowCancelEventName))
|
||||
this.element.remove()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user