Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiefu committed Dec 17, 2014
1 parent 77fb17b commit 2b78db0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
13 changes: 13 additions & 0 deletions core-drawer-panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@ polyfill-next-selector { content: '#main > [main]'; }
transition: opacity ease-in-out 0.38s, visibility ease-in-out 0.38s;
}

#edgeSwipeOverlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 20px;

This comment has been minimized.

Copy link
@fredj

fredj Dec 18, 2014

the width should be equal to edgeSwipeSensitivity

}

.right-drawer > #main > #edgeSwipeOverlay {
right: 0;
left: auto;
}

/*
narrow layout
*/
Expand Down
19 changes: 15 additions & 4 deletions core-drawer-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<div id="main" _style="left: {{ narrow || rightDrawer ? '0' : drawerWidth }}; right: {{ rightDrawer ? (narrow ? '' : drawerWidth) : '' }};">
<content select="[main]"></content>
<div id="scrim" on-tap="{{togglePanel}}"></div>
<div id="edgeSwipeOverlay" hidden?="{{!narrow || disableEdgeSwipe}}"></div>
</div>

<div id="drawer" _style="width: {{ drawerWidth }}">
Expand Down Expand Up @@ -199,7 +200,16 @@
* @type boolean
* @default false
*/
forceNarrow: false
forceNarrow: false,

/**
* If true, swipe from the edge is disable.
*
* @attribute disableEdgeSwipe
* @type boolean
* @default false
*/
disableEdgeSwipe: false
},

eventDelegates: {
Expand Down Expand Up @@ -327,9 +337,10 @@
},

isEdgeTouch: function(e) {
return this.swipeAllowed() && (this.rightDrawer ?
e.pageX >= this.offsetWidth - this.edgeSwipeSensitivity :
e.pageX <= this.edgeSwipeSensitivity);
return !this.disableEdgeSwipe && this.swipeAllowed() &&
(this.rightDrawer ?
e.pageX >= this.offsetWidth - this.edgeSwipeSensitivity :
e.pageX <= this.edgeSwipeSensitivity);
},

trackStart : function(e) {
Expand Down

0 comments on commit 2b78db0

Please sign in to comment.