mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
Merge branch 'develop' into merge-develop-into-experimental-branch
This commit is contained in:
@@ -43,9 +43,11 @@ export class FlyoutButton
|
||||
/** The radius of the flyout button's borders. */
|
||||
static BORDER_RADIUS = 4;
|
||||
|
||||
/** The key to the function called when this button is activated. */
|
||||
readonly callbackKey: string;
|
||||
|
||||
private readonly text: string;
|
||||
private readonly position: Coordinate;
|
||||
private readonly callbackKey: string;
|
||||
private readonly cssClass: string | null;
|
||||
|
||||
/** Mouse up event data. */
|
||||
@@ -97,12 +99,13 @@ export class FlyoutButton
|
||||
|
||||
this.position = new Coordinate(0, 0);
|
||||
|
||||
/** The key to the function called when this button is clicked. */
|
||||
/**
|
||||
* The key to the function called when this button is activated.
|
||||
* Check both the uppercase and lowercase version, because the docs
|
||||
* say `callbackKey` but the type says `callbackkey`.
|
||||
*/
|
||||
this.callbackKey =
|
||||
(json as AnyDuringMigration)[
|
||||
'callbackKey'
|
||||
] /* Check the lower case version
|
||||
too to satisfy IE */ ||
|
||||
(json as AnyDuringMigration)['callbackKey'] ||
|
||||
(json as AnyDuringMigration)['callbackkey'];
|
||||
|
||||
/** If specified, a CSS class to add to this button. */
|
||||
|
||||
@@ -467,6 +467,15 @@ export class Gesture {
|
||||
/* opt_noCaptureIdentifier */ true,
|
||||
),
|
||||
);
|
||||
this.boundEvents.push(
|
||||
browserEvents.conditionalBind(
|
||||
document,
|
||||
'pointercancel',
|
||||
null,
|
||||
this.handleUp.bind(this),
|
||||
/* opt_noCaptureIdentifier */ true,
|
||||
),
|
||||
);
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import {BlockSvg} from '../block_svg.js';
|
||||
import {Field} from '../field.js';
|
||||
import {Icon} from '../icons/icon.js';
|
||||
import type {IFocusableNode} from '../interfaces/i_focusable_node.js';
|
||||
import {RenderedConnection} from '../rendered_connection.js';
|
||||
|
||||
@@ -66,6 +67,8 @@ export class Marker {
|
||||
return node.getSourceBlock() as BlockSvg;
|
||||
} else if (node instanceof RenderedConnection) {
|
||||
return node.getSourceBlock();
|
||||
} else if (node instanceof Icon) {
|
||||
return node.getSourceBlock() as BlockSvg;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -46,7 +46,6 @@ export const TOUCH_MAP: {[key: string]: string[]} = {
|
||||
'mouseup': ['pointerup', 'pointercancel'],
|
||||
'touchend': ['pointerup'],
|
||||
'touchcancel': ['pointercancel'],
|
||||
'pointerup': ['pointerup', 'pointercancel'],
|
||||
};
|
||||
|
||||
/** PID of queued long-press task. */
|
||||
|
||||
Reference in New Issue
Block a user