mirror of
https://github.com/google/blockly.git
synced 2026-01-30 04:00:10 +01:00
Remove isCuttable api
This commit is contained in:
@@ -1726,11 +1726,6 @@ export class BlockSvg
|
||||
return this.isOwnDeletable() && this.isOwnMovable();
|
||||
}
|
||||
|
||||
/** Returns whether this block is cuttable or not. */
|
||||
isCuttable(): boolean {
|
||||
return this.isDeletable() && this.isMovable();
|
||||
}
|
||||
|
||||
/** Returns whether this block is movable or not. */
|
||||
override isMovable(): boolean {
|
||||
return this.dragStrategy.isMovable();
|
||||
|
||||
@@ -249,11 +249,6 @@ export class RenderedWorkspaceComment
|
||||
return this.isOwnMovable() && this.isOwnDeletable();
|
||||
}
|
||||
|
||||
/** Returns whether this comment is cuttable or not */
|
||||
isCuttable(): boolean {
|
||||
return this.isMovable() && this.isDeletable();
|
||||
}
|
||||
|
||||
/** Returns whether this comment is movable or not. */
|
||||
isMovable(): boolean {
|
||||
return this.dragStrategy.isMovable();
|
||||
|
||||
@@ -22,13 +22,6 @@ export interface ICopyable<T extends ICopyData> extends ISelectable {
|
||||
* @returns True if it can currently be copied.
|
||||
*/
|
||||
isCopyable?(): boolean;
|
||||
|
||||
/**
|
||||
* Whether this instance is currently cuttable.
|
||||
*
|
||||
* @returns True if it can currently be cut.
|
||||
*/
|
||||
isCuttable?(): boolean;
|
||||
}
|
||||
|
||||
export namespace ICopyable {
|
||||
|
||||
@@ -125,19 +125,13 @@ function isCopyable(focused: IFocusableNode): boolean {
|
||||
/**
|
||||
* Determine if a focusable node can be cut.
|
||||
*
|
||||
* This will use the isCuttable method if the node implements it, otherwise
|
||||
* it will fall back to checking if the node can be moved and deleted in its
|
||||
* current workspace.
|
||||
* This will check if the node can be both copied and deleted in its current
|
||||
* workspace.
|
||||
*
|
||||
* @param focused The focused object.
|
||||
*/
|
||||
function isCuttable(focused: IFocusableNode): boolean {
|
||||
if (!isICopyable(focused) || !isIDeletable(focused) || !isDraggable(focused))
|
||||
return false;
|
||||
if (focused.isCuttable !== undefined) {
|
||||
return focused.isCuttable();
|
||||
}
|
||||
return focused.isMovable() && focused.isDeletable();
|
||||
return isCopyable(focused) && isIDeletable(focused) && focused.isDeletable();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user