diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2024-02-21 14:46:27 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2024-02-21 14:46:27 +0300 |
| commit | aebf52efb22a64ac2b0ba203dd41b7523b7d998c (patch) | |
| tree | aa097019b67426b4be0637bfc4b5a484bd415a99 /web/html/common/text_modal.html | |
| parent | c83a1db0c8dc3d8e6c5d59372f992f0668cef433 (diff) | |
simplify log and text modals
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/html/common/text_modal.html')
| -rw-r--r-- | web/html/common/text_modal.html | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/web/html/common/text_modal.html b/web/html/common/text_modal.html index 4fe2f175..68387be2 100644 --- a/web/html/common/text_modal.html +++ b/web/html/common/text_modal.html @@ -1,15 +1,16 @@ {{define "textModal"}} <a-modal id="text-modal" v-model="txtModal.visible" :title="txtModal.title" - :closable="true" ok-text='{{ i18n "copy" }}' cancel-text='{{ i18n "close" }}' - :class="themeSwitcher.currentTheme" - :ok-button-props="{attrs:{id:'txt-modal-ok-btn'}}"> - <a-button v-if="!ObjectUtil.isEmpty(txtModal.fileName)" type="primary" style="margin-bottom: 10px;" - :href="'data:application/text;charset=utf-8,' + encodeURIComponent(txtModal.content)" - :download="txtModal.fileName"> - {{ i18n "download" }} [[ txtModal.fileName ]] - </a-button> + :closable="true" + :class="themeSwitcher.currentTheme"> + <template slot="footer"> + <a-button v-if="!ObjectUtil.isEmpty(txtModal.fileName)" icon="download" + :href="'data:application/text;charset=utf-8,' + encodeURIComponent(txtModal.content)" + :download="txtModal.fileName">[[ txtModal.fileName ]] + </a-button> + <a-button type="primary" id="copy-btn">{{ i18n "copy" }}</a-button> + </template> <a-input type="textarea" v-model="txtModal.content" - :autosize="{ minRows: 10, maxRows: 20}"></a-input> + :autosize="{ minRows: 10, maxRows: 20}"></a-input> </a-modal> <script> @@ -28,7 +29,7 @@ this.visible = true; textModalApp.$nextTick(() => { if (this.clipboard === null) { - this.clipboard = new ClipboardJS('#txt-modal-ok-btn', { + this.clipboard = new ClipboardJS('#copy-btn', { text: () => this.content, }); this.clipboard.on('success', () => { |
