From 9c37e114b20e6b2a2d4a34fe1f0e44c5ed3439ed Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 17 Dec 2025 21:33:06 +0100 Subject: shuffle: first version --- static/widgets/image/index.css | 2 +- static/widgets/image/index.js | 14 ++++++++++++-- static/widgets/index.js | 12 ++++++------ 3 files changed, 19 insertions(+), 9 deletions(-) (limited to 'static/widgets') 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); + } } diff --git a/static/widgets/index.js b/static/widgets/index.js index c468f34..6220318 100644 --- a/static/widgets/index.js +++ b/static/widgets/index.js @@ -1,6 +1,6 @@ -export Editable from './editable/index.js'; -export Image from './image/index.js'; -export MonthSelect from './month-select/index.js'; -export PasswordDialog from './password-dialog/index.js'; -export Search from './search/index.js'; -export UploadBar from './upload-bar/index.js'; +export { default as Editable } from './editable/index.js'; +export { default as Image } from './image/index.js'; +export { default as MonthSelect } from './month-select/index.js'; +export { default as PasswordDialog } from './password-dialog/index.js'; +export { default as Search } from './search/index.js'; +export { default as UploadBar } from './upload-bar/index.js'; -- cgit v1.2.3-70-g09d2