Needs work
Project:
Image Widget Crop
Version:
8.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2017 at 11:34 UTC
Updated:
3 Nov 2022 at 14:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
strykaizerComment #4
Pls commentedAgree, this is major for overall UX. Most of the time there will only be one crop type.
Comment #5
Pls commentedComment #6
csedax90 commentedPatch #2 doens't work with latest dev version
Comment #7
woprrr commentedThat should not usefull. Because details are a sort of extend of container that same...
I'm not sure about that. In js we are based a lot onto vertical tabs element to fired events. We need to test it more.
Comment #8
woprrr commentedI flag this issue prior to solve during Media Sprints DDD Sevilla. We need to talk more about UX of IWC...
Comment #9
duaelfrFixing event tag :)
Comment #10
woprrr commentedComment #11
Cauliflower commentedI rewrote the patch, based on latest 2.x-dev.
Comment #12
woprrr commentedHi @Cauliflower, Thank to your help ! and sorry for the delay actually I'm pretty busy with other contribution projects.
But I review/test it fast (today).
Comment #13
kedramonLooks good
Comment #14
woprrr commentedHii @Cauliflower,
There is my feedback about your patch.
I think we can extract this kind of test into public function like $this->hasSingleCropType() to reduce general complexity of these BIG BIG (too big and too complex) method.
I have some doubt about that part because actually we need to inform users when crop are apply or not with "Crop image (cropping applied)" flag. With this details element the UX seems more clear IMHO.
Where these class are used ? I think that sound better if we can set an attribute instead of class to sibling these element in js ?
@Pls Have you some idea to increase the UX of ImageWidgetCrop ? We are totally open to purpose and feedback about IWC interface.
Comment #15
rgeerolfPatch #11 is working for me, but not for an image field with multiple values.
Comment #16
woprrr commentedI'm come back to this issue ! @StryKaizer I have some problems by replace "details" element to container but why not play with '#open' Form Attributes to show/hide the crop area ? In 2.x whe also have a settings to control that "Always expand crop area: Yes/No" we can extend that to automatically set to Yes when widget have only one item ? What to you think about this ?
Comment #17
winn commentedI have a different approach to this problem. Rather than trying to test to see if there is just one crop type, let's allow the site builder to choose whether to use tabs on a per field instance. This has the advantage of simplifying the code, but more importantly, it means that adding a crop type does not also alter the form output. This also has the added flexibility of allowing more than one crop type to be stacked one on top of another (without the vertical tabs), if that is the desired result.
Attached is a first pass at achieving this result. I have added a "Wrapper Type" field, with options of "Vertical Tabs" and "Stacked Divs".
Comment #18
timkruijsen commentedI altered the patch in #17 to make sure it applies on the 2.2 release.
Comment #20
cslevy commentedUpdated the patch from #18 to work with the latest version 2.3.0 and 2.x-dev
Comment #21
mlncn commentedWhichever of this or #3116312: Hide vertical tabs when there is only one image style available in committed first, the other will have to be refactored.
Comment #22
proteo commentedI've testes both patches (#20 from this issue and #7 from #3116312) and they both apply and work fine. But I'd prefer the one from this issue because gives administrators more control and makes the change more predictable.
Comment #23
phenaproximaI think there are two things that should be addressed before I'd feel good about committing this.
Comment #24
heddnI think I prefer the, "less is more" approach here. Why do we need to make the type of rendering configurable. Wouldn't the approach in #3203154: Hide the crop type name when only one crop type is available be more simple? If someone really needs true configurability, then they can element info alter and change the element to their own custom implementation that lets it dance and have unicorns. But for the primary use case, swapping between details and a div are enough.