|
|
@ -1,36 +1,42 @@ |
|
|
|
<template> |
|
|
|
<div class="treenode"> |
|
|
|
<button v-on:click="debugShow = !debugShow">Ladící data</button> |
|
|
|
<details> |
|
|
|
<!-- následující řádek nefunguje, protože summary musí být první tag v details --> |
|
|
|
<!-- <div class="treenode-org"> bude tu nějaký if na class="treenode" --> |
|
|
|
|
|
|
|
<summary> |
|
|
|
<component :is='item.node.polymorphic_ctype.model' :item='item' :key='item.node.id'></component> |
|
|
|
</summary> |
|
|
|
|
|
|
|
<button v-on:click="debugShow = !debugShow" class="nodebug">Ladící data</button> <!--bude tu nějaký if na class="nodebug", v debug módu bude tlačítko vidět, jinak ne --> |
|
|
|
<div v-if="debugShow"> |
|
|
|
<pre>{{ item.node.polymorphic_ctype.model }}</pre> |
|
|
|
<pre>{{ item }}</pre> |
|
|
|
</div> |
|
|
|
<component :is='item.node.polymorphic_ctype.model' :item='item' :key='item.node.id'></component> |
|
|
|
|
|
|
|
<div v-if="item.children.length === 0"> |
|
|
|
<div v-if="item.appendable_children.length > 0"> |
|
|
|
<b>Vložit jako syna</b> |
|
|
|
<b>Vložit jako syna: </b> |
|
|
|
<addnewnode :types="item.appendable_siblings" :refnode="item.node" where="syn" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="children"> |
|
|
|
<div v-if="item.children.length > 0 && item.children[0].appendable_siblings.length > 0"> |
|
|
|
<b>Vložit před</b> |
|
|
|
<div class="children-org"> <!--bude tu nějaký if na class="children" --> |
|
|
|
<div v-if="item.children.length > 0 && item.children[0].appendable_siblings.length > 0" class="mam-org-only"> |
|
|
|
<b>Vložit před: </b> |
|
|
|
<addnewnode :types="item.children[0].appendable_siblings" :refnode="item.children[0].node" where="pred" /> |
|
|
|
</div> |
|
|
|
|
|
|
|
<ul> |
|
|
|
<li v-for="(chld, index) in item.children" v-bind:key="chld.nazev" > |
|
|
|
<div v-for="(chld, index) in item.children" v-bind:key="chld.nazev" > |
|
|
|
<TreeNode :item="chld"> |
|
|
|
</TreeNode> |
|
|
|
<div v-if="chld.appendable_siblings.length > 0"> |
|
|
|
<b v-if="index < (item.children.length - 1)">Vložit mezi</b> |
|
|
|
<b v-else>Vložit za</b> |
|
|
|
<div v-if="chld.appendable_siblings.length > 0" class="mam-org-only" id="org-only-treenode" > |
|
|
|
<b v-if="index < (item.children.length - 1)">Vložit mezi: </b> |
|
|
|
<b v-else>Vložit za: </b> |
|
|
|
<addnewnode :types="chld.appendable_siblings" :refnode="chld.node" where="za" /> |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</details> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
@ -67,29 +73,39 @@ export default { |
|
|
|
|
|
|
|
<!-- Add "scoped" attribute to limit CSS to this component only --> |
|
|
|
<style scoped> |
|
|
|
h3 { |
|
|
|
margin: 40px 0 0; |
|
|
|
|
|
|
|
/* |
|
|
|
.treenode-org { |
|
|
|
padding: 5px; |
|
|
|
margin: 5px; |
|
|
|
border: #6a0043 2px dashed; |
|
|
|
} |
|
|
|
ul { |
|
|
|
/* list-style-type: none;*/ |
|
|
|
padding: 0; |
|
|
|
*/ |
|
|
|
|
|
|
|
.children-org { |
|
|
|
padding: 5px; |
|
|
|
margin: 5px; |
|
|
|
border: #6a0043 2px solid; |
|
|
|
} |
|
|
|
li { |
|
|
|
/*display: inline-block;*/ |
|
|
|
margin: 0 10px; |
|
|
|
|
|
|
|
.mam-org-only { |
|
|
|
margin: 4px; |
|
|
|
} |
|
|
|
a { |
|
|
|
color: #42b983; |
|
|
|
|
|
|
|
.nodebug { |
|
|
|
display: none; |
|
|
|
} |
|
|
|
|
|
|
|
.treenode { |
|
|
|
border: 1px solid; |
|
|
|
border-color: "black"; |
|
|
|
margin: 5px; |
|
|
|
/* jsou potřeba obě verze, jedna funguje pro chrome a druhá pro firefox */ |
|
|
|
details > summary:first-of-type { |
|
|
|
list-style-type: none; |
|
|
|
} |
|
|
|
.children { |
|
|
|
border: 1px solid; |
|
|
|
border-color: #ff0000; |
|
|
|
margin: 5px; |
|
|
|
details summary::-webkit-details-marker { |
|
|
|
display:none; |
|
|
|
} |
|
|
|
|
|
|
|
details summary { |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|