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

onZoom drag to next image #2

Open
dishwashwebdesign opened this issue Jun 17, 2013 · 0 comments
Open

onZoom drag to next image #2

dishwashwebdesign opened this issue Jun 17, 2013 · 0 comments

Comments

@dishwashwebdesign
Copy link

On the ImageViewer carousel example you got those listeners set:

[CODE]
onDragStart: function(e) {
var scroller = this.getActiveItem().getScrollable().getScroller();
if (e.targetTouches.length === 1 && (e.deltaX < 0 && scroller.getMaxPosition().x === scroller.position.x) || (e.deltaX > 0 && scroller.position.x === 0)) {
this.callParent(arguments);
}
},
onDrag: function(e) {
if (e.targetTouches.length == 1)
this.callParent(arguments);
},
onDragEnd: function(e) {
if (e.targetTouches.length < 2)
this.callParent(arguments);
}
[/CODE]

I am assuming this is preventing to switch to the next image in the carousel.
However, I am struggling to get those same listeners set in my config.

Within an modal container:
[CODE]
initialize: function() {
var me = this;
me.element.on({
dragstart: function(){
me.fireEvent('onDragStart');
},
drag: function() {
me.fireEvent('onDrag');
},
dragend: function() {
me.fireEvent('onDragEnd');
}
});
[/CODE]

and in the matching controller events there is the same code as in the example.
For some silly reason the scroller can not get initialized and so no checks for the drag events can be done.
any inputs or thoughts?

never mind, i did this workaround using the post as seen on
http://www.sencha.com/forum/showthread.php?197903-Pinch-Image-with-carousel-and-working-fine/page5

thanks anyway, issue can be closed/removed.

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

No branches or pull requests

1 participant