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 {
height: 3em;
}
label {
display: flex;
}
}
.specs {
@ -228,6 +231,10 @@
font-size: 75%;
line-height: initial;
}
label {
display: flex;
}
}
.stats {

View File

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

View File

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