mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
Added clickToClose flag that allows to block closing modal on background click (#35)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
class="v--modal-overlay"
|
||||
:aria-expanded="visible.toString()"
|
||||
:data-modal="name"
|
||||
@mousedown.stop="toggle(false)">
|
||||
@mousedown.stop="onBackgroundClick">
|
||||
<div class="v--modal-top-right">
|
||||
<slot name="top-right"/>
|
||||
</div>
|
||||
@@ -62,6 +62,10 @@
|
||||
transition: {
|
||||
type: String
|
||||
},
|
||||
clickToClose: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
classes: {
|
||||
type: [String, Array],
|
||||
default: 'v--modal',
|
||||
@@ -346,6 +350,12 @@
|
||||
}
|
||||
},
|
||||
|
||||
onBackgroundClick () {
|
||||
if (this.clickToClose) {
|
||||
this.toggle(false)
|
||||
}
|
||||
},
|
||||
|
||||
addDraggableListeners () {
|
||||
if (!this.draggable) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user