daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.08k stars 618 forks source link

Minor feature requests #751

Closed SidIcarus closed 1 year ago

SidIcarus commented 2 years ago

Environments

Description

Hello! Thank you for your phenomenal library. I've been using the library for a bit now and feel like these additions would be beneficial.

Currently, upon rotating/resizing/dragging the moveable-control-box acquires the class moveable-dragging.

I'm performing both of the above within their respective event handlers but it would be justifiable to have the library do this given it partially already does.

Thoughts?

Separate from above

daybrush commented 2 years ago

@SidIcarus

Request: Adding the respective action class: moveable-resizing, moveable-rotating, etc.? perhaps either always adding them or as a MoveableOption Request : Adding the respective action class to the targets perhaps either always adding them or as a MoveableOption

This is a very nice feature. I will add it later.

Request: exposing the evaluated target(s): such as inner moveable properties _elementTargets and/or selectorMap? Scenario: you have a reference to moveable but also want to know the elements without having re-retrieve

What does mean? What do you mean by updateSelectors or getElements?

Request: option for horizontalGuidelines and/or verticalGuidelines to always be rendered

It seems difficult. It seems to be a problematic feature.

SidIcarus commented 2 years ago

This is a very nice feature. I will add it later.

Wonderful. Thank you!

What does mean? What do you mean by updateSelectors or getElements?

The library has target: MoveableRefTargetType which can be non-direct references to the elements, such as selectors, functions, etcetera. From what I've seen, it evaluates the option and keeps a reference to the resultant.

image

I was thinking that instead of the developer also keeping track of that resultant, the API could expose one or all of these properties as it already has them. This would reduce the number of query calls needed to retrieves those elements and prevent a disconnect from what the developer is keeping track of and what the library has.

It seems difficult. It seems to be a problematic feature.

Ah I understand. I have a workaround for this. Thank you for looking into it!

daybrush commented 2 years ago

@SidIcarus

moveable's new version is released.

During dragging, moveable-dragging and moveable-{{ableName}}-dragging class names are added. And getTargets method was added.

Check it again.

SidIcarus commented 2 years ago

Thank you for your work on this.

I see the classes on the control-box for single targets but not for the group events nor on the targets. Dragging a group does add moveable-dragArea-dragging.

SidIcarus commented 2 years ago

Also looks like .moveable-roundable-dragging does not get added to the .viewContainer.

daybrush commented 2 years ago

@SidIcarus

Okay. I'll add it soon.

daybrush commented 1 year ago

@SidIcarus

moveable's new version is released.

The corresponding class name will be appended to the viewContainer. moveable-{ableName}-view-dragging