Skip to content

Commit 6f4b2a1

Browse files
committed
Add dragTargetWidth option
1 parent 7bf14e0 commit 6f4b2a1

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

jade/page-contents/sidenav_content.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ <h3 class="header">Options</h3>
127127
<td>true</td>
128128
<td>Allow swipe gestures to open/close Sidenav.</td>
129129
</tr>
130+
<tr>
131+
<td>dragTargetWidth</td>
132+
<td>String</td>
133+
<td>'10px'</td>
134+
<td>Width of the area where you can start dragging.</td>
135+
</tr>
130136
<tr>
131137
<td>inDuration</td>
132138
<td>Number</td>
@@ -397,4 +403,4 @@ <h4>Fixed HTML Structure</h4>
397403
</div>
398404

399405
</div>
400-
</div>
406+
</div>

js/sidenav.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
let _defaults = {
55
edge: 'left',
66
draggable: true,
7+
dragTargetWidth: '10px',
78
inDuration: 250,
89
outDuration: 200,
910
onOpenStart: null,
@@ -34,6 +35,7 @@
3435
* @member Sidenav#options
3536
* @prop {String} [edge='left'] - Side of screen on which Sidenav appears
3637
* @prop {Boolean} [draggable=true] - Allow swipe gestures to open/close Sidenav
38+
* @prop {String} [dragTargetWidth='10px'] - Width of the area where you can start dragging
3739
* @prop {Number} [inDuration=250] - Length in ms of enter transition
3840
* @prop {Number} [outDuration=200] - Length in ms of exit transition
3941
* @prop {Function} onOpenStart - Function called when sidenav starts entering
@@ -394,6 +396,7 @@
394396
_createDragTarget() {
395397
let dragTarget = document.createElement('div');
396398
dragTarget.classList.add('drag-target');
399+
dragTarget.style.width = this.options.dragTargetWidth;
397400
document.body.appendChild(dragTarget);
398401
this.dragTarget = dragTarget;
399402
}

0 commit comments

Comments
 (0)