Update
This commit is contained in:
parent
d11ce1d7a5
commit
c61cbabca7
4 changed files with 6 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ export const items = [
|
|||
},
|
||||
{
|
||||
icon: 'UnskilledLabour2.svg',
|
||||
linkable: ['Gefährdete Gesundheit'],
|
||||
linkable: ['Gefährdete Gesundheit', 'Überarbeitet', 'Arm'],
|
||||
img: 'hans.png',
|
||||
name: 'Hans',
|
||||
desc: '12, Kinderarbeiter',
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ export class Display {
|
|||
target.addEventListener('dragstart', e => {
|
||||
let target = findA(e.target)
|
||||
if (!target || !target.draggable) return
|
||||
e.dataTransfer.clearData()
|
||||
e.dataTransfer.setData('application/prs.x', target.dataset['id'])
|
||||
e.dataTransfer.effectAllowed = 'link'
|
||||
})
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ class Actions {
|
|||
state.show = null
|
||||
}
|
||||
link(from, to) {
|
||||
if (from == to) return false
|
||||
const ok = state.items[from].linkable.filter(i => state.items[to].linkable.includes(i)).length > 0
|
||||
if (!ok) return false
|
||||
state.links.push({id: state.links.length, from, to})
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ body {
|
|||
text-align: center;
|
||||
position: absolute;
|
||||
transform-origin: 0 0;
|
||||
font-size: 1.2em;
|
||||
font-size: 1.4em;
|
||||
padding: 0 70px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue