From 864bbb81d0c375829afd85e97f92961decd6274e Mon Sep 17 00:00:00 2001 From: Svetoslav Tsenov Date: Mon, 1 May 2017 23:29:38 +0300 Subject: [PATCH] Fix myview test page in layouts suit --- apps/app/ui-tests-app/layouts-percent/myview.ts | 14 ++++++++++++-- apps/app/ui-tests-app/layouts/myview-base.ts | 5 +++++ apps/app/ui-tests-app/layouts/myview.ts | 8 ++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/apps/app/ui-tests-app/layouts-percent/myview.ts b/apps/app/ui-tests-app/layouts-percent/myview.ts index 92ae630f0..a10a96a3c 100644 --- a/apps/app/ui-tests-app/layouts-percent/myview.ts +++ b/apps/app/ui-tests-app/layouts-percent/myview.ts @@ -26,6 +26,16 @@ export class ViewModelWithPercentage extends ViewModelBase { } } + + public onMinWidthMinHeight(args: { eventName: string, object: any }): void { + let view = args.object; + if (!PercentLength.equals(view.marginLeft, 105)) { + super.setMinWidthHeight(view, 105, 55); + } else { + super.setMinWidthHeight(view, 0, 0); + } + } + public onAllProperties(args: { eventName: string, object: any }): void { let child: any; let layout: any = args.object.parent; @@ -41,9 +51,9 @@ export class ViewModelWithPercentage extends ViewModelBase { // MinWidthMinHeight child = layout.getViewById("minWidthMinHeight"); if (child.minWidth !== 105) { - super.setWidthHeight(child, 105, 55); + super.setMinWidthHeight(child, 105, 55); } else { - super.setWidthHeight(child, 0, 0); + super.setMinWidthHeight(child, 0, 0); } // Margins diff --git a/apps/app/ui-tests-app/layouts/myview-base.ts b/apps/app/ui-tests-app/layouts/myview-base.ts index bb98a7265..0214653ff 100644 --- a/apps/app/ui-tests-app/layouts/myview-base.ts +++ b/apps/app/ui-tests-app/layouts/myview-base.ts @@ -35,6 +35,11 @@ export class ViewModelBase extends Observable { child.height = height; } + protected setMinWidthHeight(child: any, minWidth: any, minHeight: any) { + child.minWidth = minWidth; + child.minHeight = minHeight; + } + protected setMargins(child: any, marginLeft: any, marginTop: any, marginRight: any, marginBottom: any) { child.marginLeft = marginLeft; child.marginTop = marginTop; diff --git a/apps/app/ui-tests-app/layouts/myview.ts b/apps/app/ui-tests-app/layouts/myview.ts index 937b7d082..115e91836 100644 --- a/apps/app/ui-tests-app/layouts/myview.ts +++ b/apps/app/ui-tests-app/layouts/myview.ts @@ -20,9 +20,9 @@ export class ViewModel extends ViewModelBase { public onMinWidthMinHeight(args: { eventName: string, object: any }): void { var view: View = args.object; if (view.minWidth !== 105) { - super.setWidthHeight(view, 105, 55); + super.setMinWidthHeight(view, 105, 55); } else { - super.setWidthHeight(view, 0, 0); + super.setMinWidthHeight(view, 0, 0); } } @@ -50,9 +50,9 @@ export class ViewModel extends ViewModelBase { // MinWidthMinHeight child = layout.getViewById("minWidthMinHeight"); if (child.minWidth !== 105) { - super.setWidthHeight(child, 105, 55); + super.setMinWidthHeight(child, 105, 55); } else { - super.setWidthHeight(child, 0, 0); + super.setMinWidthHeight(child, 0, 0); } // Margins child = layout.getViewById("margins");