File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ For examples see [`dev/`](dev/).
39
39
| ---:| --- | ---| --- |
40
40
| width | Number | 240 | width of the side-nav |
41
41
| 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 |
43
44
| fixed | Boolean | false | should always show on large screens |
44
45
| is-opened | Boolean | false | (two-way) opens or closes the side-nav |
45
46
| is-fixed | Boolean | false | (two-way) true when fixed on large screen |
@@ -66,6 +67,11 @@ npm run dev
66
67
```
67
68
Browse to ` http://localhost:8080/ ` .
68
69
70
+ ## Changelog
71
+
72
+ - 0.3.0
73
+ renamed ` not-dismissible ` to ` not-dismissable ` . added ` close-on-click `
74
+
69
75
## License
70
76
Copyright (c) 2016 Paul Pflugradt
71
77
Licensed under the MIT license.
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ drag-handle(
46
46
)
47
47
ul(
48
48
v-el:nav
49
- @click ="dismiss "
49
+ @click ="onClick "
50
50
@keyup.esc ="dismiss"
51
51
v-bind:style ="computedStyle"
52
52
v-bind:class ="computedClass"
@@ -89,7 +89,10 @@ module.exports =
89
89
" right" :
90
90
type : Boolean
91
91
default : false
92
- " notDismissible" :
92
+ " notDismissable" :
93
+ type : Boolean
94
+ default : false
95
+ " closeOnClick" :
93
96
type : Boolean
94
97
default : false
95
98
" fixed" :
@@ -175,9 +178,12 @@ module.exports =
175
178
@isFixed = false
176
179
@disposeWindowResize ? ()
177
180
@ setParentMargin ()
181
+ onClick : (e ) ->
182
+ if @closeOnClick
183
+ @ dismiss (e)
178
184
dismiss : (e ) ->
179
185
unless e .defaultPrevented
180
- if ! @notDismissible and not @isFixed
186
+ if ! @notDismissable and not @isFixed
181
187
@ close ()
182
188
e .preventDefault ()
183
189
You can’t perform that action at this time.
0 commit comments