Custom panel insert locations

This commit is contained in:
JannisX11 2020-09-26 12:04:40 +02:00
parent c03b3ede3e
commit 21d5030949

View File

@ -18,7 +18,16 @@ class Panel {
// Vue
if (data.component) {
data.component.name = 'inside-vue'
$(`.sidebar#${data.default_side||'left'}_bar`).append(`<div id="mount-panel-${this.id}"></div>`)
let bar = $(`.sidebar#${data.default_side||'left'}_bar`);
let node = $(`<div id="mount-panel-${this.id}"></div>`);
if (data.insert_before && bar.find(`> .panel#${data.insert_before}`).length) {
node.insertBefore(bar.find(`> .panel#${data.insert_before}`));
} else if (data.insert_after && bar.find(`> .panel#${data.insert_after}`).length) {
node.insertAfter(bar.find(`> .panel#${data.insert_after}`));
} else {
bar.append(node)
}
this.vue = new Vue({
components: {