fix pagebuilder

This commit is contained in:
2024-10-02 14:07:16 +02:00
parent a75ac0921d
commit 32e098322c
2 changed files with 30 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "magico-pagebuilder",
"version": "0.0.19",
"version": "0.0.20",
"private": true,
"scripts": {
"dev": "vite",

View File

@@ -6,7 +6,7 @@
</div>
<div class="col-sm-12 col-md-6 p-0 text-end">
<a href="#" @click.prevent="modalBox = !modalBox" title="Edytuj" class="text-primary me-2"
<a href="#" @click.prevent="openModal" title="Edytuj" class="text-primary me-2"
><i class="material-icons-outlined">create</i></a
>
<b-modal
@@ -16,18 +16,19 @@
:title="langs.label"
v-on:hide="onCloseModal"
>
<div class="mb-4">
<div style="min-height: 400px">
<div class="mb-4" v-if="delayModal">
<div class="form-group">
<editor
api-key="no-api-key"
rows="12"
class="form-control"
v-if="modalBox"
v-model="text"
:init="vtinymce"
/>
</div>
</div>
</div>
<div class="d-flex">
<button class="btn btn-outline-secondary m-auto" @click.prevent="onCloseModal">
{{ langs.saveclose }}
@@ -46,6 +47,7 @@ import MagicoModal from './../MagicoModal.vue'
import tinymceConfig from '../tinymce/config.js'
import Editor from '@tinymce/tinymce-vue'
import { nextTick } from 'vue'
export default {
emits: ['update:modelValue'],
components: {
@@ -72,9 +74,14 @@ export default {
},
height: window.innerHeight - window.innerHeight / 4,
modalBox: false,
delayModal: false,
editor: null,
text: '',
name: 'core_section_textarea',
vtinymce: Object.assign(tinymceConfig, {
setup: function (e) {
console.log(e)
},
file_picker_callback: (callback) => {
if (this.$filechooser) {
this.$filechooser.open({
@@ -108,6 +115,16 @@ export default {
}
},
methods: {
openModal: function () {
let vm = this
this.modalBox = true
setTimeout(function () {
vm.delayModal = true
}, 200)
// nextTick(() => {
// vm.delayModal = true
// })
},
removeItem: function () {
this.$emit('itemRemoved', this.modelValue)
},
@@ -115,6 +132,7 @@ export default {
setTimeout(
function () {
this.modalBox = false
this.delayModal = false
this.$emit('update:modelValue', {
name: this.name,
text: this.text