mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-10 21:18:53 -04:00
Octave button handlers directly call octave changers
This commit is contained in:
parent
0044907732
commit
b688375b28
1 changed files with 6 additions and 19 deletions
|
@ -461,10 +461,13 @@ Blockly.FieldNote.prototype.showEditor_ = function() {
|
|||
Blockly.FieldNote.OCTAVE_BUTTON_SIZE, false, svg);
|
||||
|
||||
this.octaveDownMouseDownWrapper_ =
|
||||
Blockly.bindEvent_(this.octaveDownButton, 'mousedown', this, this.onOctaveDown_);
|
||||
Blockly.bindEvent_(this.octaveDownButton, 'mousedown', this, function() {
|
||||
this.changeOctaveBy_(-1);
|
||||
});
|
||||
this.octaveUpMouseDownWrapper_ =
|
||||
Blockly.bindEvent_(this.octaveUpButton, 'mousedown', this, this.onOctaveUp_);
|
||||
|
||||
Blockly.bindEvent_(this.octaveUpButton, 'mousedown', this,function() {
|
||||
this.changeOctaveBy_(1);
|
||||
});
|
||||
Blockly.DropDownDiv.setColour(this.sourceBlock_.parentBlock_.getColour(),
|
||||
this.sourceBlock_.getColourTertiary());
|
||||
Blockly.DropDownDiv.setCategory(this.sourceBlock_.parentBlock_.getCategory());
|
||||
|
@ -697,22 +700,6 @@ Blockly.FieldNote.playNote_ = function(/* noteNum, id*/) {
|
|||
return;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle the event when the octave down button is pressed.
|
||||
* @private
|
||||
*/
|
||||
Blockly.FieldNote.prototype.onOctaveDown_ = function() {
|
||||
this.changeOctaveBy_(-1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle the event when the octave up button is pressed.
|
||||
* @private
|
||||
*/
|
||||
Blockly.FieldNote.prototype.onOctaveUp_ = function() {
|
||||
this.changeOctaveBy_(1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Change the selected note by a number of octaves, and start the animation.
|
||||
* @param {number} octaves The number of octaves to change by.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue