diff options
Diffstat (limited to 'static/widgets/image')
| -rw-r--r-- | static/widgets/image/index.css | 2 | ||||
| -rw-r--r-- | static/widgets/image/index.js | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/static/widgets/image/index.css b/static/widgets/image/index.css index 063e5b1..bfca517 100644 --- a/static/widgets/image/index.css +++ b/static/widgets/image/index.css @@ -3,7 +3,7 @@ height: 100%; min-height: 100px; border-radius: var(--border-radius); - overflow: none; + overflow: hidden; box-shadow: #223223aa 1px 1px 4px; background: var(--card-background); } diff --git a/static/widgets/image/index.js b/static/widgets/image/index.js index 76419ea..3e403bd 100644 --- a/static/widgets/image/index.js +++ b/static/widgets/image/index.js @@ -13,10 +13,13 @@ export default class Image extends sfw.element.Container { #month #date #id_element + #disabled constructor() { super ({ css }) + this.#disabled = false; + this.body.append( this.#container = Div.new({ id: 'container', @@ -70,8 +73,10 @@ export default class Image extends sfw.element.Container { }) ], ondblclick: (e) => { - this.#menu.classList.toggle('open'); - e.preventDefault(); + if (!this.#disabled) { + this.#menu.classList.toggle('open'); + e.preventDefault(); + } } }) ); @@ -93,4 +98,9 @@ export default class Image extends sfw.element.Container { get month() { return this.#month; } + + set disabled(value) { + this.#disabled = value; + this.#image.setAttribute('draggable', !value); + } } |