|
@@ -123,7 +123,7 @@ const myNewComponentTypes = (editor) => {
|
|
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
|
const csrfToken = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
|
|
|
|
|
|
const editor = grapesjs.init({
|
|
const editor = grapesjs.init({
|
|
- container: '#gjs',
|
|
+ container: '#mtb_visual_editor',
|
|
fromElement: true,
|
|
fromElement: true,
|
|
height: '100%',
|
|
height: '100%',
|
|
width: '100%',
|
|
width: '100%',
|
|
@@ -326,13 +326,16 @@ editor.on('load', () => {
|
|
customSelect = document.querySelector('.custom-select');
|
|
customSelect = document.querySelector('.custom-select');
|
|
|
|
|
|
const sendButton = document.createElement('button');
|
|
const sendButton = document.createElement('button');
|
|
- sendButton.textContent = 'publish';
|
|
+ sendButton.textContent = publishBtnName;
|
|
sendButton.classList.add('send-button');
|
|
sendButton.classList.add('send-button');
|
|
sendButton.classList.add('layui-btn');
|
|
sendButton.classList.add('layui-btn');
|
|
sendButton.classList.add('layui-btn-radius');
|
|
sendButton.classList.add('layui-btn-radius');
|
|
sendButton.classList.add('layui-btn-radius');
|
|
sendButton.classList.add('layui-btn-radius');
|
|
sendButton.style = 'margin-left:10px;height:25px;line-height:25px;padding:0 10px;vertical-align:unset;';
|
|
sendButton.style = 'margin-left:10px;height:25px;line-height:25px;padding:0 10px;vertical-align:unset;';
|
|
customSelect.insertAdjacentElement('afterend', sendButton);
|
|
customSelect.insertAdjacentElement('afterend', sendButton);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ layer.close(loadIndex);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -360,15 +363,18 @@ editor.on('update', () => {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
-
|
|
+
|
|
-var layer = layui.layer;
|
|
|
|
-var loadIndex = null;
|
|
|
|
editor.on('asset:upload:start', () => {
|
|
editor.on('asset:upload:start', () => {
|
|
loadIndex = layer.load(0, {shade: [0.5, '#000']});
|
|
loadIndex = layer.load(0, {shade: [0.5, '#000']});
|
|
});
|
|
});
|
|
|
|
|
|
-
|
|
|
|
editor.on('asset:upload:end', () => {
|
|
editor.on('asset:upload:end', () => {
|
|
layer.close(loadIndex);
|
|
layer.close(loadIndex);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+
|
|
|
|
+layui.use('flow', function(){
|
|
|
|
+ var flow = layui.flow;
|
|
|
|
+
|
|
|
|
+ flow.lazyimg();
|
|
|
|
+});
|