Custom panel insert locations
This commit is contained in:
parent
c03b3ede3e
commit
21d5030949
@ -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: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user