Skip to content

Commit

Permalink
Work for #6573: remove setElementMaxMinWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Aug 8, 2023
1 parent b874b55 commit d9c2876
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
11 changes: 0 additions & 11 deletions src/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export class QuestionRowModel extends Base {
var preSetWidthElements = [];
for (var i = 0; i < this.elements.length; i++) {
var el = this.elements[i];
this.setElementMaxMinWidth(el);

if (el.isVisible) {
(<any>el).isSingleInRow = isSingleInRow;
Expand Down Expand Up @@ -182,16 +181,6 @@ export class QuestionRowModel extends Base {
}
}
}
public setElementMaxMinWidth(el: IElement): void {
if (
el.width &&
typeof el.width === "string" &&
el.width.indexOf("%") === -1
) {
el.minWidth = el.width;
el.maxWidth = el.width;
}
}

private getRenderedCalcWidth(
el: IElement,
Expand Down
22 changes: 0 additions & 22 deletions tests/paneltests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -786,28 +786,6 @@ QUnit.test(
}
);

QUnit.test("QuestionRowModel setElementMaxMinWidth", function (assert) {
const qrm = new QuestionRowModel(<any>{ areInvisibleElementsShowing: false });

const el1: any = {
width: "100px",
minWidth: settings.minWidth,
maxWidth: settings.maxWidth,
};
qrm.setElementMaxMinWidth(el1);
assert.equal(el1.minWidth, "100px", "minWidth in 'px' is set");
assert.equal(el1.maxWidth, "100px", "maxWidth in 'px' is set");

const el2: any = {
width: "20%",
minWidth: settings.minWidth,
maxWidth: settings.maxWidth,
};
qrm.setElementMaxMinWidth(el2);
assert.equal(el2.minWidth, "300px", "minWidth in '%' is default");
assert.equal(el2.maxWidth, "100%", "maxWidth in '%' is default");
});

QUnit.test("Page/Panel.getProgressInfo()", function (assert) {
const page = new PageModel("q1");
const panel1 = page.addNewPanel("panel1");
Expand Down

0 comments on commit d9c2876

Please sign in to comment.