Skip to content

Commit

Permalink
No animation for imga carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausSchaefers committed Aug 5, 2024
1 parent 189770e commit b6cc596
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/canvas/toolbar/components/DataSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -783,11 +783,11 @@ export default {
this._renderImagesDropDown(model,"images");
this._renderDropDown(model,"vertical",[
{ value:false, icon:"ScrollHorizontal", label : "Horizontal Scrolling"},
{ value:true, icon:"ScrollVertical", label : "Vertical Scrolling"}
{ value:true, icon:"ScrollVertical", label : "Vertical Scrolling"},
{ value:'none', icon:"DeleteX", label : "No Animation"}
]);
this._renderReferenceButton(model,"backButton", "No Back Button", "Reference", "ReferenceNone");
this._renderReferenceButton(model,"nextButton", "No Next Button", "Reference", "ReferenceNone");
},
_showIconToggle (model){
Expand Down
22 changes: 19 additions & 3 deletions src/core/widgets/ImageCarousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ export default {
onDndStart(e) {
this.stopEvent(e);
this.cleanUp();
if (this._noAnimation) {
const pos = this.value + 1
this.onSlideDone(pos, e, "widgetID", 0)
return
}
this.dndStartPos = this.getMouse(e);
this.moveListener = this.addTouchMove(
Expand Down Expand Up @@ -84,7 +89,8 @@ export default {
onDndEnd(e) {
this.stopEvent(e);
var pos = this.getMouse(e);
this.emitMouseMove(e);
var delta = {
Expand Down Expand Up @@ -200,7 +206,8 @@ export default {
this.style = style;
this._scaleX = scaleX;
this._scaleY = scaleY;
this._vertical = this.model.props.vertical;
this._vertical = this.model.props.vertical === true;
this._noAnimation = this.model.props.vertical === 'none';
const db = new DomBuilder();
this.elements = [];
Expand Down Expand Up @@ -259,6 +266,10 @@ export default {
onBack(widgetID, e) {
const pos = this.value - 1;
if (this._noAnimation) {
this.onSlideDone(pos, e, widgetID, -2)
return
}
const anim = new Animation().createAnimation();
anim.duration = this.animationDuration;
anim.onRender(lang.hitch(this, "renderSlideLeft", 0));
Expand All @@ -270,6 +281,11 @@ export default {
onNext(widgetID, e) {
const pos = this.value + 1;
if (this._noAnimation) {
this.onSlideDone(pos, e, widgetID, 0)
return
}
const anim = new Animation().createAnimation();
anim.duration = this.animationDuration;
anim.onRender(lang.hitch(this, "renderSlideRight", 0));
Expand Down

0 comments on commit b6cc596

Please sign in to comment.