Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Panel: Do not close in response to a default-prevented swipe event #6947

Closed

Conversation

gabrielschulhof
Copy link

Fixes gh-6925

Note: This fix requires #6946 even though the automated tests pass, because in the automated tests I trigger swipe manually, with .trigger( "swipeleft" ) instead of calculating it from mouse events using the swipe special event. #6946 ensures that the swipe special event triggers correctly.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling 3045191 on 6925-panel-ignores-default-prevented-swipe into cfc1195 on master.

@Ruffio
Copy link

Ruffio commented May 30, 2014

Shouldn't this PR be closed as it has been merged into master?

@gabrielschulhof
Copy link
Author

@Ruffio this has not yet been merged into master, AFAIK.

if ( self.options.position === "left" ) {
area.on( "swipeleft.panel", function(/* e */) {
self.close();
// close the panel on swipe if the swipe event's default is not prevented
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capital for first word in comment

@gabrielschulhof gabrielschulhof force-pushed the 6925-panel-ignores-default-prevented-swipe branch from 3045191 to 2ce29a8 Compare August 22, 2014 09:47
@coveralls
Copy link

Coverage Status

Coverage increased (+0.11%) when pulling 2ce29a8 on 6925-panel-ignores-default-prevented-swipe into 2dd9cf4 on master.

area.on( "swiperight.panel", function(/* e */) {
self.close();
this._on( area, {
swiperight: "_handleSwipe"
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole if...else can be simplified to

var event = {};

event[ "swipe" + this.options.position ] = "_handleSwipe";
this._on( area, event );

@gabrielschulhof gabrielschulhof force-pushed the 6925-panel-ignores-default-prevented-swipe branch from 2ce29a8 to 8a72392 Compare December 5, 2014 10:57
@arschmitz
Copy link
Contributor

👍

@gabrielschulhof gabrielschulhof deleted the 6925-panel-ignores-default-prevented-swipe branch December 22, 2014 09:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panel: Automatically hide with a mouse gesture on it.
4 participants