drag equipped items

This commit is contained in:
Mashy 2019-11-04 16:02:48 +10:00
parent 61b57827e3
commit bb50037e0e
3 changed files with 29 additions and 17 deletions

View File

@ -203,6 +203,9 @@
button { button {
height: 3em; height: 3em;
} }
label {
display: flex;
}
} }
.specs { .specs {
@ -228,6 +231,10 @@
font-size: 75%; font-size: 75%;
line-height: initial; line-height: initial;
} }
label {
display: flex;
}
} }
.stats { .stats {

View File

@ -153,15 +153,17 @@ function Construct(props) {
const classes = `${equipping ? 'equipping' : ''} ${!skill ? 'empty' : ''} ${border()}`; const classes = `${equipping ? 'equipping' : ''} ${!skill ? 'empty' : ''} ${border()}`;
return ( return (
<button <label onDragStart={skillClick} key={i} draggable="true">
key={i} <button
disabled={!skill && !equipping} key={i}
class={classes} disabled={!skill && !equipping}
onClick={skillClick} class={classes}
onDblClick={skillDblClick} onClick={skillClick}
onMouseOver={e => hoverInfo(e, skill && skill.skill)} > onDblClick={skillDblClick}
{s} onMouseOver={e => hoverInfo(e, skill && skill.skill)} >
</button> {s}
</button>
</label>
); );
}); });
@ -195,13 +197,15 @@ function Construct(props) {
return ( return (
<button <label onDragStart={specClick} key={i} draggable="true">
key={i} <button
onClick={specClick} key={i}
onDblClick={specDblClick} onClick={specClick}
onMouseOver={e => hoverInfo(e, s)} > onDblClick={specDblClick}
{shapes[s]()} onMouseOver={e => hoverInfo(e, s)} >
</button> {shapes[s]()}
</button>
</label>
); );
}); });

View File

@ -306,7 +306,8 @@ class Vbox extends preact.Component {
// removing // removing
const combinerIndex = combiner.indexOf(i); const combinerIndex = combiner.indexOf(i);
if (combinerIndex > -1) { if (combinerIndex > -1) {
return combinerChange(without(combiner, i)); return true;
// return combinerChange(without(combiner, i));
} }
combiner.push(i); combiner.push(i);