Skip to content

Commit

Permalink
PR: LIBRARY: Change onDragDropAllow options (#7370)
Browse files Browse the repository at this point in the history
* work for the #7336

* work for the #7336

* Fix descriptions

---------

Co-authored-by: RomanTsukanov <sergeich16@gmail.com>
  • Loading branch information
dmitry-kurmanov and RomanTsukanov committed Nov 20, 2023
1 parent fe0ae50 commit b11fa06
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/drag-drop-page-helper-v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ export class DragDropPageHelperV1 {
allow: true,
target: this.dragDropInfo.target,
source: this.dragDropInfo.source,
toElement: this.dragDropInfo.target,
draggedElement: this.dragDropInfo.source,
parent: parent,
fromElement: this.dragDropInfo.source ? this.dragDropInfo.source.parent : null,
insertAfter: insertAfter,
insertBefore: insertBefore,
};
Expand Down
24 changes: 18 additions & 6 deletions src/survey-events-api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IAction } from "./actions/action";
import { Base } from "./base";
import { IElement, ISurveyElement, IValueItemCustomPropValues } from "./base-interfaces";
import { IElement, IPanel, ISurveyElement, IValueItemCustomPropValues } from "./base-interfaces";
import { ItemValue } from "./itemvalue";
import { PageModel } from "./page";
import { PanelModel, PanelModelBase } from "./panel";
Expand Down Expand Up @@ -841,27 +841,39 @@ export interface DragDropAllowEvent {
/**
* A survey element being dragged.
*/
target: IElement;
draggedElement: IElement;
/**
* A survey element from which `target` is being dragged. This parameter is `null` if `target` is being dragged from the [Toolbox](https://surveyjs.io/survey-creator/documentation/toolbox).
* A survey element from which `draggedElement` is being dragged. This parameter is `null` if `draggedElement` is being dragged from the [Toolbox](https://surveyjs.io/survey-creator/documentation/toolbox).
*/
source: IElement;
fromElement: IPanel;
/**
* A survey element to which `draggedElement` is being dragged.
*/
toElement: IElement;
/**
* A survey element before which the target element will be placed. This parameter is `null` if the parent container (page or panel) has no elements or if the target element will be placed below all other elements within the container.
*/
insertBefore: IElement;
/**
* A survey element after which `target` will be placed. This parameter is `null` if the parent container (page or panel) has no elements or if `target` will be placed above all other elements within the container.
* A survey element after which `draggedElement` will be placed. This parameter is `null` if the parent container (page or panel) has no elements or if `draggedElement` will be placed above all other elements within the container.
*/
insertAfter: IElement;
/**
* A parent container (page or panel) within which `target` will be placed.
* A parent container (page or panel) within which `draggedElement` will be placed.
*/
parent: ISurveyElement;
/**
* A Boolean property that you can set to `false` if you want to cancel the drag and drop operation.
*/
allow: boolean;
/**
* Obsolete. Use `options.draggedElement` instead.
*/
target: IElement;
/**
* Obsolete. Use `options.toElement` instead.
*/
source: IElement;
}
export interface ScrollingElementToTopEvent {
/**
Expand Down

0 comments on commit b11fa06

Please sign in to comment.