Skip to content

Commit 70c6ec1

Browse files
committed
feat(overlay): add keepInPlace option in overlay samples
1 parent 9d1452d commit 70c6ec1

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/app/overlay/overlay.sample.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@
8686
<igx-switch class="settings" [(ngModel)]="hasAnimation" name="outlet" [value]="hasAnimation"
8787
(change)="onSwitchChange($event)">Has animation</igx-switch>
8888
</div>
89+
<div>
90+
<igx-switch class="settings" [(ngModel)]="keepInPlace" name="outlet" [value]="keepInPlace"
91+
(change)="onSwitchChange($event)">Keep In Place</igx-switch>
92+
</div>
8993
<div>
9094
<igx-input-group>
9195
<input igxInput name="dropDownItems" type="number" [(ngModel)]="itemsCount">

src/app/overlay/overlay.sample.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export class OverlaySampleComponent implements OnInit {
6060
public modal = true;
6161
public useOutlet = false;
6262
public hasAnimation = true;
63+
public keepInPlace = false;
6364
public animationLength = 300; // in ms
6465

6566
private xAddition = 0;
@@ -90,7 +91,8 @@ export class OverlaySampleComponent implements OnInit {
9091
positionStrategy: new AutoPositionStrategy(),
9192
scrollStrategy: new NoOpScrollStrategy(),
9293
modal: false,
93-
closeOnOutsideClick: true
94+
closeOnOutsideClick: true,
95+
keepInPlace: this.keepInPlace
9496
};
9597
this.horizontalDirection = 'Right';
9698
this.verticalDirection = 'Bottom';
@@ -106,7 +108,8 @@ export class OverlaySampleComponent implements OnInit {
106108
positionStrategy: new ConnectedPositioningStrategy(),
107109
scrollStrategy: new NoOpScrollStrategy(),
108110
modal: false,
109-
closeOnOutsideClick: true
111+
closeOnOutsideClick: true,
112+
keepInPlace: this.keepInPlace
110113
};
111114
this.horizontalDirection = 'Right';
112115
this.verticalDirection = 'Bottom';
@@ -147,7 +150,8 @@ export class OverlaySampleComponent implements OnInit {
147150
}),
148151
scrollStrategy: new NoOpScrollStrategy(),
149152
modal: false,
150-
closeOnOutsideClick: true
153+
closeOnOutsideClick: true,
154+
keepInPlace: this.keepInPlace
151155
};
152156
this.horizontalDirection = 'Right';
153157
this.verticalDirection = 'Bottom';
@@ -225,7 +229,7 @@ export class OverlaySampleComponent implements OnInit {
225229
positionStrategy: stringMapping['PositionStrategy'][this.positionStrategy],
226230
scrollStrategy: stringMapping['ScrollStrategy'][this.scrollStrategy],
227231
modal: this.modal,
228-
closeOnOutsideClick: this.closeOnOutsideClick
232+
closeOnOutsideClick: this.closeOnOutsideClick,
229233
};
230234
this._overlaySettings.positionStrategy.settings.verticalDirection =
231235
stringMapping['VerticalDirection'][this.verticalDirection];
@@ -236,6 +240,7 @@ export class OverlaySampleComponent implements OnInit {
236240
this._overlaySettings.positionStrategy.settings.horizontalStartPoint =
237241
stringMapping['HorizontalStartPoint'][this.horizontalStartPoint];
238242
this._overlaySettings.outlet = this.useOutlet ? this.outletElement : null;
243+
this._overlaySettings.keepInPlace = this.keepInPlace;
239244
}
240245

241246
public onSwitchChange(ev: IChangeCheckboxEventArgs) {
@@ -249,6 +254,9 @@ export class OverlaySampleComponent implements OnInit {
249254
case 'outlet':
250255
this._overlaySettings.outlet = ev.checked ? this.outletElement : null;
251256
break;
257+
case 'keepInPlace':
258+
this._overlaySettings.keepInPlace = ev.checked;
259+
break;
252260
}
253261
}
254262

0 commit comments

Comments
 (0)