Skip to content

Commit

Permalink
fix: rename mouseDownWrapper fields for Blockly v12 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
cwillisf committed Dec 10, 2024
1 parent 2d86986 commit adaf531
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/fields/field_matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class FieldMatrix extends Blockly.Field<string> {
* Touch event wrapper.
* Runs when the field is selected.
*/
private mouseDownWrapper: Blockly.browserEvents.Data | null = null;
private mouseDownWrapper_: Blockly.browserEvents.Data | null = null;

/**
* Touch event wrapper.
Expand Down Expand Up @@ -558,8 +558,8 @@ class FieldMatrix extends Blockly.Field<string> {
dispose() {
super.dispose();
this.matrixStage_ = null;
if (this.mouseDownWrapper) {
Blockly.browserEvents.unbind(this.mouseDownWrapper);
if (this.mouseDownWrapper_) {
Blockly.browserEvents.unbind(this.mouseDownWrapper_);
}
if (this.matrixTouchWrapper_) {
Blockly.browserEvents.unbind(this.matrixTouchWrapper_);
Expand Down
8 changes: 4 additions & 4 deletions src/fields/scratch_field_angle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ScratchFieldAngle extends Blockly.FieldNumber {
/**
* Opaque identifier used to unbind event listener in dispose().
*/
private mouseDownWrapper: Blockly.browserEvents.Data;
private mouseDownWrapper_: Blockly.browserEvents.Data;

/**
* Opaque identifier used to unbind event listener in dispose().
Expand Down Expand Up @@ -142,8 +142,8 @@ class ScratchFieldAngle extends Blockly.FieldNumber {
dispose() {
super.dispose();
this.gauge = null;
if (this.mouseDownWrapper) {
Blockly.browserEvents.unbind(this.mouseDownWrapper);
if (this.mouseDownWrapper_) {
Blockly.browserEvents.unbind(this.mouseDownWrapper_);
}
if (this.mouseUpWrapper) {
Blockly.browserEvents.unbind(this.mouseUpWrapper);
Expand Down Expand Up @@ -286,7 +286,7 @@ class ScratchFieldAngle extends Blockly.FieldNumber {
this.getSourceBlock() as Blockly.BlockSvg
);

this.mouseDownWrapper = Blockly.browserEvents.bind(
this.mouseDownWrapper_ = Blockly.browserEvents.bind(
this.handle,
"mousedown",
this,
Expand Down

0 comments on commit adaf531

Please sign in to comment.