Skip to content
This repository was archived by the owner on Jul 5, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function getBlockForm($value, $block, $model = null) {
'cssUrls' => function() {
$cssUrls = array_map(function($arr) {
if(array_key_exists('preview', $arr)) {
return array_key_exists('css', $arr['preview']) ? $arr['preview']['css'] : '';
return array_key_exists('css', $arr['preview']) ? url($arr['preview']['css']) : '';
}
}, $this->fieldsets);
$cssUrls = array_filter($cssUrls);
Expand All @@ -76,7 +76,7 @@ function getBlockForm($value, $block, $model = null) {
'jsUrls' => function() {
$jsUrls = array_map(function($arr) {
if(array_key_exists('preview', $arr)) {
return array_key_exists('js', $arr['preview']) ? $arr['preview']['js'] : '';
return array_key_exists('js', $arr['preview']) ? url($arr['preview']['js']) : '';
}
}, $this->fieldsets);
$jsUrls = array_filter($jsUrls);
Expand Down
34 changes: 9 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/components/BuilderField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ export default {
},
mounted() {
for (const [fieldSetKey, cssUrl] of Object.entries(this.cssUrls)) {
fetch("/" + cssUrl.replace(/^\/+/g, "")) //regex removes leading slashes
fetch(cssUrl)
.then(res => {
return res.text();
})
.then(res => {
this.$set(this.cssContents, fieldSetKey, res);
});
}
for (const [fieldSetKey, jsUrls] of Object.entries(this.jsUrls)) {
fetch("/" + jsUrls.replace(/^\/+/g, "")) //regex removes leading slashes
for (const [fieldSetKey, jsUrl] of Object.entries(this.jsUrls)) {
fetch(jsUrl)
.then(res => {
return res.text();
})
Expand Down Expand Up @@ -207,9 +207,9 @@ export default {
},
onDragEnd(event) {
this.dragging = false;
this.$root.$emit("blockMoved");
},
onMove(event) {
this.$root.$emit("blockMoved");
return event.relatedContext.index != this.value.length + 1;
},
onStartDrag(event) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/BuilderPreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default {
},
methods: {
updateContent() {
this.$nextTick().then(() => {
this.$nextTick(() => {
if (this.$refs["previewFrame"]) {
this.previewFrameWindow = this.$refs["previewFrame"].contentWindow;
this.previewFrameDocument = this.previewFrameWindow.document;
Expand All @@ -106,7 +106,7 @@ export default {
});
},
updateFrameIfEmpty() {
this.$nextTick().then(() => {
this.$nextTick(() => {
if (this.$refs["previewFrame"]) {
const contentElement = this.$refs[
"previewFrame"
Expand Down