-
Notifications
You must be signed in to change notification settings - Fork 116
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
Do not open the option containers after dropping a snippet + Fix and improve the drag and drop from right panel and dropzones + on snippet preview resource + ImageSnippet option #4259
Conversation
This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg, it needs to be retargeted before it can be merged. |
f7df808
to
35f3199
Compare
27a1402
to
8c6b756
Compare
6d52155
to
c9af27a
Compare
This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg, it needs to be retargeted before it can be merged. |
After dropping, we want to stay on the block tab, to drag other blocks afterwards.
+ adapt "Button" option accordingly
c9af27a
to
0373a5b
Compare
dropzoneEls = this.shared.dropzone.activateDropzones(selectors, { | ||
toInsertInline: isInlineSnippet, | ||
}); | ||
this.onDropzoneStart(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should probably call this.dispatchTo("on_dropzone_start_handlers")
here. it is more robust than relying on monkey patches
/** | ||
* Hooks allowing other modules to react to drop zones being enabled. | ||
*/ | ||
onDropzoneStart() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you should dispatch events instead
this.hideSnippetToolTip?.(); | ||
|
||
this.shared.operation.next(async () => { | ||
await new Promise((resolve) => (dragAndDropResolve = () => resolve())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use a deferred instead (from web/utils/concurrency). maybe it would be clearer
// Preview the snippet correctly. | ||
// Note: no async previews, in order to not slow down the drag. | ||
this.cancelSnippetPreview = this.shared.history.makeSavePoint(); | ||
this.resources["on_snippet_preview_handlers"]?.forEach((onSnippetPreview) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe, it would be better to call a shared function from dropzoneplugin instead. and that's a more general statement. the dropzone plugin should be the main coordinator of the drag and drop process, not the block tab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice
No description provided.