fix pagebuilder
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "magico-pagebuilder",
|
"name": "magico-pagebuilder",
|
||||||
"version": "0.0.19",
|
"version": "0.0.20",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-12 col-md-6 p-0 text-end">
|
<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
|
><i class="material-icons-outlined">create</i></a
|
||||||
>
|
>
|
||||||
<b-modal
|
<b-modal
|
||||||
@@ -16,16 +16,17 @@
|
|||||||
:title="langs.label"
|
:title="langs.label"
|
||||||
v-on:hide="onCloseModal"
|
v-on:hide="onCloseModal"
|
||||||
>
|
>
|
||||||
<div class="mb-4">
|
<div style="min-height: 400px">
|
||||||
<div class="form-group">
|
<div class="mb-4" v-if="delayModal">
|
||||||
<editor
|
<div class="form-group">
|
||||||
api-key="no-api-key"
|
<editor
|
||||||
rows="12"
|
api-key="no-api-key"
|
||||||
class="form-control"
|
rows="12"
|
||||||
v-if="modalBox"
|
class="form-control"
|
||||||
v-model="text"
|
v-model="text"
|
||||||
:init="vtinymce"
|
:init="vtinymce"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
@@ -46,6 +47,7 @@ import MagicoModal from './../MagicoModal.vue'
|
|||||||
import tinymceConfig from '../tinymce/config.js'
|
import tinymceConfig from '../tinymce/config.js'
|
||||||
|
|
||||||
import Editor from '@tinymce/tinymce-vue'
|
import Editor from '@tinymce/tinymce-vue'
|
||||||
|
import { nextTick } from 'vue'
|
||||||
export default {
|
export default {
|
||||||
emits: ['update:modelValue'],
|
emits: ['update:modelValue'],
|
||||||
components: {
|
components: {
|
||||||
@@ -72,9 +74,14 @@ export default {
|
|||||||
},
|
},
|
||||||
height: window.innerHeight - window.innerHeight / 4,
|
height: window.innerHeight - window.innerHeight / 4,
|
||||||
modalBox: false,
|
modalBox: false,
|
||||||
|
delayModal: false,
|
||||||
|
editor: null,
|
||||||
text: '',
|
text: '',
|
||||||
name: 'core_section_textarea',
|
name: 'core_section_textarea',
|
||||||
vtinymce: Object.assign(tinymceConfig, {
|
vtinymce: Object.assign(tinymceConfig, {
|
||||||
|
setup: function (e) {
|
||||||
|
console.log(e)
|
||||||
|
},
|
||||||
file_picker_callback: (callback) => {
|
file_picker_callback: (callback) => {
|
||||||
if (this.$filechooser) {
|
if (this.$filechooser) {
|
||||||
this.$filechooser.open({
|
this.$filechooser.open({
|
||||||
@@ -108,6 +115,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
openModal: function () {
|
||||||
|
let vm = this
|
||||||
|
this.modalBox = true
|
||||||
|
setTimeout(function () {
|
||||||
|
vm.delayModal = true
|
||||||
|
}, 200)
|
||||||
|
// nextTick(() => {
|
||||||
|
// vm.delayModal = true
|
||||||
|
// })
|
||||||
|
},
|
||||||
removeItem: function () {
|
removeItem: function () {
|
||||||
this.$emit('itemRemoved', this.modelValue)
|
this.$emit('itemRemoved', this.modelValue)
|
||||||
},
|
},
|
||||||
@@ -115,6 +132,7 @@ export default {
|
|||||||
setTimeout(
|
setTimeout(
|
||||||
function () {
|
function () {
|
||||||
this.modalBox = false
|
this.modalBox = false
|
||||||
|
this.delayModal = false
|
||||||
this.$emit('update:modelValue', {
|
this.$emit('update:modelValue', {
|
||||||
name: this.name,
|
name: this.name,
|
||||||
text: this.text
|
text: this.text
|
||||||
|
|||||||
Reference in New Issue
Block a user