Fix led color picker (#1698)

Fix led color picker
10.7.0-preview
Michael Keller 2019-09-30 18:34:53 +13:00 committed by GitHub
commit 79cf12a63d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 36 deletions

View File

@ -239,13 +239,13 @@
display: inline-block;
position: absolute;
z-index: 10000;
background: white;
background: var(--boxBackground);
padding: 5px;
margin: 10px;
border-color: #565656;
border-style: solid;
border-radius: 6px;
border-width: 2px;
width: 167px;
}
.tab-led-strip .color-1 {background: white;}
@ -346,7 +346,6 @@
position: relative;
float: left;
width: 285px;
margin-right: 10px;
}
.colorDefineSliderValue,

View File

@ -265,22 +265,10 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
updateBulkCmd();
});
$('.colors').on('dblclick', 'button', function(e) {
var pp = $('.tab-led-strip').position();
var moveLeft = $('.tab-led-strip').position().left + ($('.colorDefineSliders').width() / 2);
var moveUp = $('.tab-led-strip').position().top + $('.colorDefineSliders').height() + 20;
$('.colorDefineSliders').css('left', e.pageX - e.offsetX - moveLeft);
$('.colorDefineSliders').css('top', e.pageY - e.offsetY - moveUp);
$('.colors').on('dblclick', 'button', function() {
$('.colorDefineSliders').css('left', $(this).position().left - $('.colorDefineSliders').width() / 2 + $(this).width());
$('.colorDefineSliders').css('top', $(this).position().top + 26);
$('.colorDefineSliders').show();
});
$('.colorDefineSliders').on({
mouseleave: function () {
$('.colorDefineSliders').hide();
}
});
$('.colors').children().on({

View File

@ -26,24 +26,6 @@
<div class="block"></div>
<div class="block"></div>
</div>
<div class="colorDefineSliders">
<div class="" i18n="ledStripColorSetupTitle"/>
<div class="colorDefineSliderContainer">
<Label class="colorDefineSliderLabel" i18n="ledStripH"></Label>
<input class="sliderHSV" type="range" min="0" max="359" value="0">
<Label class="colorDefineSliderValue Hvalue">0</Label>
</div>
<div class="colorDefineSliderContainer">
<Label class="colorDefineSliderLabel" i18n="ledStripS"></Label>
<input class="sliderHSV" type="range" min="0" max="255" value="0">
<Label class="colorDefineSliderValue Svalue">0</Label>
</div>
<div class="colorDefineSliderContainer">
<Label class="colorDefineSliderLabel" i18n="ledStripV"></Label>
<input class="sliderHSV" type="range" min="0" max="255" value="0">
<Label class="colorDefineSliderValue Vvalue">0</Label>
</div>
</div>
<div class="controls">
<div class="wires-remaining">
<div></div>
@ -158,6 +140,24 @@
</div>
<div class="colors">
<div class="colorDefineSliders">
<div class="" i18n="ledStripColorSetupTitle"/>
<div class="colorDefineSliderContainer">
<Label class="colorDefineSliderLabel" i18n="ledStripH"></Label>
<input class="sliderHSV" type="range" min="0" max="359" value="0">
<Label class="colorDefineSliderValue Hvalue">0</Label>
</div>
<div class="colorDefineSliderContainer">
<Label class="colorDefineSliderLabel" i18n="ledStripS"></Label>
<input class="sliderHSV" type="range" min="0" max="255" value="0">
<Label class="colorDefineSliderValue Svalue">0</Label>
</div>
<div class="colorDefineSliderContainer">
<Label class="colorDefineSliderLabel" i18n="ledStripV"></Label>
<input class="sliderHSV" type="range" min="0" max="255" value="0">
<Label class="colorDefineSliderValue Vvalue">0</Label>
</div>
</div>
<button class="color-0" i18n_title="colorBlack">0</button>
<button class="color-1" i18n_title="colorWhite">1</button>
<button class="color-2" i18n_title="colorRed">2</button>