Merge pull request #1382 from ivanixgames/fix1381a

Fix behavior of color picker on sensor blocks
This commit is contained in:
Paul Kaplan 2018-03-08 09:27:42 -05:00 committed by GitHub
commit 7c61985d31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -834,7 +834,7 @@ Blockly.Css.CONTENT = [
'.blocklyDropDownDiv .goog-slider-horizontal .goog-slider-thumb {',
'width: 26px;',
'height: 26px;',
'margin-top: -1px;',
'top: -1px;',
'position: absolute;',
'background-color: white;',
'border-radius: 100%;',

View file

@ -288,6 +288,7 @@ Blockly.FieldColourSlider.prototype.showEditor_ = function() {
this.hueSlider_.setUnitIncrement(5);
this.hueSlider_.setMinimum(0);
this.hueSlider_.setMaximum(360);
this.hueSlider_.setMoveToPointEnabled(true);
this.hueSlider_.render(div);
var saturationElements = this.createLabelDom_(
@ -296,6 +297,7 @@ Blockly.FieldColourSlider.prototype.showEditor_ = function() {
div.appendChild(saturationElements[0]);
this.saturationReadout_ = saturationElements[1];
this.saturationSlider_ = new goog.ui.Slider();
this.saturationSlider_.setMoveToPointEnabled(true);
this.saturationSlider_.setUnitIncrement(0.01);
this.saturationSlider_.setStep(0.001);
this.saturationSlider_.setMinimum(0);
@ -311,6 +313,7 @@ Blockly.FieldColourSlider.prototype.showEditor_ = function() {
this.brightnessSlider_.setUnitIncrement(2);
this.brightnessSlider_.setMinimum(0);
this.brightnessSlider_.setMaximum(255);
this.brightnessSlider_.setMoveToPointEnabled(true);
this.brightnessSlider_.render(div);
Blockly.FieldColourSlider.hueChangeEventKey_ = goog.events.listen(this.hueSlider_,