mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
add $askMdConfirmation helper
This commit is contained in:
parent
153787a6a1
commit
9b650163e8
1 changed files with 13 additions and 0 deletions
|
@ -39,6 +39,19 @@ Vue.prototype.$askConfirmation = function (message, props) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vue.prototype.$askMdConfirmation = function (markdown, props, ok = false) {
|
||||||
|
const content = this.$createElement('vue-showdown', {
|
||||||
|
props: { markdown, flavor: 'github', options: { headerLevelStart: 4 } }
|
||||||
|
})
|
||||||
|
return this.$bvModal['msgBox' + (ok ? 'Ok' : 'Confirm')](content, {
|
||||||
|
okTitle: this.$i18n.t('yes'),
|
||||||
|
cancelTitle: this.$i18n.t('cancel'),
|
||||||
|
headerBgVariant: 'warning',
|
||||||
|
headerClass: store.state.theme ? 'text-white' : 'text-black',
|
||||||
|
centered: true,
|
||||||
|
...props
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Register global components
|
// Register global components
|
||||||
const requireComponent = require.context('@/components/globals', true, /\.(js|vue)$/i)
|
const requireComponent = require.context('@/components/globals', true, /\.(js|vue)$/i)
|
||||||
|
|
Loading…
Reference in a new issue