AlchemyCMS / alchemy_cms

Alchemy is the Open Source Rails CMS framework for the component based web that can be used as classic server side rendered or headless CMS.
https://www.alchemy-cms.com
BSD 3-Clause "New" or "Revised" License
817 stars 313 forks source link

Library/Images picture selection is buggy #2960

Open ovinix opened 2 days ago

ovinix commented 2 days ago

1. Checkbox issue

Steps to reproduce

  1. Check picture checkbox
  2. Uncheck picture checkbox

Expected behavior

Picture checkbox is available again on hover

Actual behavior

Picture checkbox is not available again on hover

2. Toolbar issue

Steps to reproduce

  1. Check one or multiple pictures

Expected behavior

Toolbar with Delete button is visible

Actual behavior

Toolbar with Delete button is not visible

Suggested solution

Make changes in app/javascript/alchemy_admin/picture_selector.js

  1. To fix first issue remove:

    parentElementClassList.toggle("hidden", !checked)
  2. To fix second issue replace:

    selectedItemTools.style.display = checkedInputs().length > 0 ? "block" : "none"

    with:

    selectedItemTools.classList.toggle("hidden", checkedInputs().length === 0);

System configuration