-
Notifications
You must be signed in to change notification settings - Fork 118
add carousel option #4250
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
add carousel option #4250
Conversation
This PR targets the un-managed branch odoo-dev/odoo:master-mysterious-egg, it needs to be retargeted before it can be merged. |
54c3bee
to
7b7f49a
Compare
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.
Here's a first review. I didn't test functionally, but I have 2 main points:
- most of this code should probably be done in an edit interaction, not in the options plugin
- when you
addSlide
, you should probably call the clone plugin.
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
const slideTimestamp = editingElement.addEventListener("slid.bs.carousel", () => { | ||
const slideTimestamp = window.performance.now(); | ||
// overlay should be handled by optionContainer | ||
// setTimeout(() => this.trigger_up("hide_overlay")); |
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.
same question here
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
}); | ||
|
||
// rewrite the jquery interface in carousel.js | ||
const carouselInstance = window.Carousel.getOrCreateInstance(editingElement); |
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.
Watch out that you need to get the iframe's window, here you take the global window
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
f468b7f
to
80b3d5d
Compare
8d9a9cf
to
cf055d0
Compare
27a1402
to
8c6b756
Compare
dda2df3
to
553226c
Compare
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 there is some work left, many features still don't work.
- history (undo / redo) after sliding or adding a slide
- addSlide doesn't trigger a sliding animation
- change indicators type then click doesn't work
- change the arrows then click doesn't work
- ...
But while some are due to the PR, some functionalities don't work well in master either. The carousel is clearly very tricky and I'm not sure of what would be the best choices here. Even more so if we take into consideration that the same classes are used in different snippets.
On another note, the Carousel
public widget inherited from CarouselHandler
, with the method _updateIndicatorAndActivateSnippet
. I don't think it is in use anywhere now, shouldn't you reimplement it too? 🤔
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
addons/html_builder/static/src/plugins/carousel_option_plugin.js
Outdated
Show resolved
Hide resolved
484d846
to
51195fe
Compare
4648461
to
2d7aa09
Compare
8dd80e2
to
1ccbada
Compare
8fcbd86
to
821aec5
Compare
@@ -122,6 +124,7 @@ export class BuilderNumberInput extends Component { | |||
} | |||
const unit = this.props.unit; | |||
const saveUnit = this.props.saveUnit; | |||
const withUnit = this.props.withUnit; |
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.
why do you need withUnit ? we don t need it in the old api
step="0.1" | ||
min="0" | ||
preview="false" | ||
withUnit="false"/> |
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.
applyWithUnit
821aec5
to
770dd88
Compare
770dd88
to
95fe961
Compare
No description provided.