## html
## scss-global
.input-no-native{
/* Firefox */
-moz-appearance: textfield;
/* Chrome, Safari, Edge, Opera */
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
&:focus{
outline: none;
}
}
.scrollable-number-input{
display: inline-block;
margin: 2px -10px 5px 5px;
input{
cursor: w-resize;
background: #313131;
color: white;
border: none;
text-align: center;
border-radius: 10px;
}
}
## js-global
Blackprint.Sketch.registerInterface('BPIC/Input/UI/SliderBox',
class SliderBoxIFace extends Context.IFace.SliderBoxIFace {
dragMove(ev, item){
this.focusIndex = this.data.indexOf(item);
function onMove(ev){
item.value += item.step * ev.movementX;
}
var that = this;
var doc = $(ev.view.document);
doc.on('pointermove', onMove).once('pointerup', {capture:true}, function(ev2){
doc.off('pointermove', onMove);
if(ev2.timeStamp - ev.timeStamp < 100)
$('input', that.data.getElements(item)).focus();
});
}
mouseWheel(ev, item){
this.focusIndex = this.data.indexOf(item);
item.value -= item.step * Math.sign(ev.deltaY);
}
});