-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
44 lines (44 loc) · 985 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
panel.plugin('medienbaecker/modules', {
components: {
'k-modules-section': {
extends: 'k-pages-section',
created: function () {
if (this.parent == 'site') return;
this.$api.post(this.parent + '/modules').then((data) => {
if (data.created) {
this.reload();
}
});
},
computed: {
type() {
return 'modules';
}
},
methods: {
onAdd() {
if (this.canAdd) {
this.$dialog('pages/create', {
query: {
parent: this.options.link || this.parent,
view: this.parent,
section: this.name,
modules: this.options.layout
}
});
}
}
}
}
},
fields: {
modules_redirect: {
props: {
redirect: String
},
render: function () {
window.location.href = this.redirect;
}
}
}
});