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

Enable slide dragging only on the toolbar #47

Open
pcazajous opened this issue May 19, 2013 · 3 comments
Open

Enable slide dragging only on the toolbar #47

pcazajous opened this issue May 19, 2013 · 3 comments

Comments

@pcazajous
Copy link

Hello,

I was trying to enable the slide only by dragging the toolbar.
I found that I can set the containerSlideDelay to "-1" to disable the dragging from the container and to let the dragging enabled on the toolbar.

This correctly works on Google Chrome, but doesn't work on an Android mobile (Android GingerBread 2.3.5).

Does anyone have an idea to fix this ?

@DenninDalke
Copy link

Did you try to set slideSelector to 'x-toolbar'?

@pcazajous
Copy link
Author

Yes, by default it is set to 'x-toolbar' but all the container is draggable, not only the toolbar.

@jforaker
Copy link

You have to comment out the following lines of of View.js so it looks like this:

// Create optional drag-on-container functionality
// if (containerSlideDelay > -1) {
// container.element.on({
// drag: function(e, node, opts, eOpts) {
// deltaX = e.absDeltaX;
// deltaY = e.absDeltaY;
//
// // This essentally acts as a vertical 'scroll-lock'. If the user drags more
// // than 10px vertically, we disable horizontal drag all together.
// if (deltaY > 10 && !container.dragAllowed) {
// container.dragAllowedForced = true;
// return false;
// };
//
// // If vertical scroll-lock hasn't been enforced (dragAllowedForced), and
// // deltaX is large enough, enable horizontal dragging
// if (deltaX > containerSlideDelay && !container.dragAllowed && !container.dragAllowedForced) {
// if (!container.dragAllowed) {
// scrollParent = me.container.getActiveItem().down('component[scrollable]');
// if (scrollParent) {
// scrollable = scrollParent.getScrollable();
// scroller = scrollable.getScroller();
// scroller._scrollState = scroller.getDisabled();
//
// console.log(scroller.getDisabled() != false);
//
// if (scroller._scrollState != false) {
// scroller.setDisabled(true);
// scrollable.hideIndicators();
// }
// }
// }
//
// container.dragAllowed = true;
// container.element.fireEvent('dragstart');
// }
// },
// dragend: function() {
// if (container.dragAllowed) {
// // Re-enable scrolling on the child element
// scrollParent = me.container.getActiveItem().down('component[scrollable]');
// if (scrollParent) {
// scrollable = scrollParent.getScrollable();
// scroller = scrollable.getScroller();
// scroller._scrollState = scroller.getDisabled();
//
// if (scroller._scrollState != false) {
// scroller.setDisabled(null);
// scrollable.hideIndicators();
// }
// }
// }
//
// container.dragAllowedForced = false;
// container.dragAllowed = false;
// }
// });
// }

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

3 participants