Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed Nov 16, 2023
1 parent 59e388c commit f90277a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/dragdrop/choices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { QuestionSelectBase } from "../question_baseselect";
import { DragDropCore } from "./core";

export class DragDropChoices extends DragDropCore<QuestionSelectBase> {
private imagepickerControlsNode: HTMLElement;

protected get draggedElementType(): string {
return "item-value";
}
Expand Down Expand Up @@ -76,11 +78,11 @@ export class DragDropChoices extends DragDropCore<QuestionSelectBase> {
`;

const itemValueNode = draggedElementNode.closest("[data-sv-drop-target-item-value]");
const controlsNode: HTMLElement = itemValueNode.querySelector(".svc-image-item-value-controls");
this.imagepickerControlsNode = itemValueNode.querySelector(".svc-image-item-value-controls");
const imageContainerNode: any = itemValueNode.querySelector(".sd-imagepicker__image-container");
let imageNode: any = itemValueNode.querySelector(item.imageLink ? "img" : ".sd-imagepicker__no-image").cloneNode(true);

controlsNode.style.display = "none";
this.imagepickerControlsNode.style.display = "none";
imageContainerNode.style.width = imageNode.width + "px";
imageContainerNode.style.height = imageNode.height + "px";

Expand Down Expand Up @@ -212,6 +214,8 @@ export class DragDropChoices extends DragDropCore<QuestionSelectBase> {
if(!!this.parentElement) {
this.updateVisibleChoices(this.parentElement);
}
this.imagepickerControlsNode.style.display = "flex";
this.imagepickerControlsNode = null;
super.clear();
}

Expand Down

0 comments on commit f90277a

Please sign in to comment.