Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pasting into parent element with only one nested element type #2292

Merged
merged 2 commits into from
Apr 21, 2022

Conversation

dbwinger
Copy link
Contributor

What is this pull request for?

Before this change, the new element dialog (including the option to paste) is not shown when adding a nested element when the parent element only has a one nestable element type.
This change shows the dialog in this case only if the clipboard contains an element with the name of the nestable element type. In this case, the element select is disabled (and shows the only option).

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@dbwinger dbwinger force-pushed the paste-single-element branch 3 times, most recently from 1ff59b9 to 8e12921 Compare April 12, 2022 23:33
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works well, unless you copy the element from the same page, because the button doesn't update the link on the "Add nested element button". A bit tricky, but you could update the link via Javascript on "copy element". This is kind of an edge case, though.

@dbwinger
Copy link
Contributor Author

This works well, unless you copy the element from the same page, because the button doesn't update the link on the "Add nested element button". A bit tricky, but you could update the link via Javascript on "copy element". This is kind of an edge case, though.

Good point. I just took a crack at that.

@dbwinger dbwinger force-pushed the paste-single-element branch from d9f8331 to 9d40c82 Compare April 15, 2022 12:34
@dbwinger dbwinger force-pushed the paste-single-element branch from 0211346 to 95b3d39 Compare April 15, 2022 13:59
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@tvdeyen tvdeyen merged commit 9982f07 into AlchemyCMS:main Apr 21, 2022
@dbwinger dbwinger deleted the paste-single-element branch April 21, 2022 14:14
tvdeyen added a commit that referenced this pull request Apr 26, 2022
Allow pasting into parent element with only one nested element type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants