Skip to content

Commit 59f2b40

Browse files
committed
see changelog
1 parent de14ba9 commit 59f2b40

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ For examples see [`dev/`](dev/).
3939
| ---:| --- | ---| --- |
4040
| width | Number | 240 | width of the side-nav |
4141
| hide-on-screen-size | Number | 992 | Used with `fixed`. Above this size, the menu will stay opened. |
42-
| not-dismissible | Boolean | false | A click within the side-nav will not dismiss it |
42+
| not-dismissable | Boolean | false | A click on the overlay will not dismiss it |
43+
| close-on-click | Boolean | false | Any click within the side-nav will close it |
4344
| fixed | Boolean | false | should always show on large screens |
4445
| is-opened | Boolean | false | (two-way) opens or closes the side-nav |
4546
| is-fixed | Boolean | false | (two-way) true when fixed on large screen |
@@ -66,6 +67,11 @@ npm run dev
6667
```
6768
Browse to `http://localhost:8080/`.
6869

70+
## Changelog
71+
72+
- 0.3.0
73+
renamed `not-dismissible` to `not-dismissable`. added `close-on-click`
74+
6975
## License
7076
Copyright (c) 2016 Paul Pflugradt
7177
Licensed under the MIT license.

src/side-nav.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ drag-handle(
4646
)
4747
ul(
4848
v-el:nav
49-
@click="dismiss"
49+
@click="onClick"
5050
@keyup.esc="dismiss"
5151
v-bind:style="computedStyle"
5252
v-bind:class="computedClass"
@@ -89,7 +89,10 @@ module.exports =
8989
"right":
9090
type: Boolean
9191
default: false
92-
"notDismissible":
92+
"notDismissable":
93+
type: Boolean
94+
default: false
95+
"closeOnClick":
9396
type: Boolean
9497
default: false
9598
"fixed":
@@ -175,9 +178,12 @@ module.exports =
175178
@isFixed = false
176179
@disposeWindowResize?()
177180
@setParentMargin()
181+
onClick: (e) ->
182+
if @closeOnClick
183+
@dismiss(e)
178184
dismiss: (e) ->
179185
unless e.defaultPrevented
180-
if !@notDismissible and not @isFixed
186+
if !@notDismissable and not @isFixed
181187
@close()
182188
e.preventDefault()
183189

0 commit comments

Comments
 (0)