mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-30 19:20:40 +00:00
Added more options for confirm modal
The ability to set the title of the modal has been added, as well as custom callbacks for the no option. Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
This commit is contained in:
parent
66d5408aad
commit
0d6a8b2101
1 changed files with 14 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 id="exampleModalLabel" class="modal-title">
|
<h5 id="exampleModalLabel" class="modal-title">
|
||||||
{{ $t("Confirm") }}
|
{{ title || $t("Confirm") }}
|
||||||
</h5>
|
</h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" />
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
<button type="button" class="btn" :class="btnStyle" data-bs-dismiss="modal" @click="yes">
|
<button type="button" class="btn" :class="btnStyle" data-bs-dismiss="modal" @click="yes">
|
||||||
{{ yesText }}
|
{{ yesText }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="no">
|
||||||
{{ noText }}
|
{{ noText }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,8 +44,13 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: "No",
|
default: "No",
|
||||||
},
|
},
|
||||||
|
/** Title to show on modal. Defaults to translated version of "Config" */
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
emits: [ "yes" ],
|
emits: [ "yes", "no" ],
|
||||||
data: () => ({
|
data: () => ({
|
||||||
modal: null,
|
modal: null,
|
||||||
}),
|
}),
|
||||||
|
@ -63,6 +68,12 @@ export default {
|
||||||
yes() {
|
yes() {
|
||||||
this.$emit("yes");
|
this.$emit("yes");
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* @emits string "no" Notify the parent when No is pressed
|
||||||
|
*/
|
||||||
|
no() {
|
||||||
|
this.$emit("no");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue