-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(snapshot): add assistive popover to change direction (#11976)
- Loading branch information
1 parent
d0ae810
commit bb57474
Showing
5 changed files
with
64 additions
and
10 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
...s/snapshot/test/basic/components/assistive-touch/assistive-popover/assistive-popover.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<ion-list no-margin> | ||
<button ion-item (click)="homeButton()">Home Button</button> | ||
<button ion-item (click)="flipDirection()">Flip Direction</button> | ||
</ion-list> |
21 changes: 21 additions & 0 deletions
21
...pshot/test/basic/components/assistive-touch/assistive-popover/assistive-popover.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { AssistivePopover } from './assistive-popover'; | ||
import { NgModule } from '@angular/core'; | ||
import { IonicPageModule } from '../../../../../../../module'; | ||
import { AssistiveTouchProvider } from '../../../providers/assistive-touch/assistive-touch'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
AssistivePopover, | ||
], | ||
imports: [ | ||
IonicPageModule.forChild(AssistivePopover), | ||
], | ||
exports: [ | ||
AssistivePopover | ||
], | ||
providers: [ | ||
AssistiveTouchProvider | ||
] | ||
}) | ||
export class AssistivePopoverModule { | ||
} |
29 changes: 29 additions & 0 deletions
29
...nts/snapshot/test/basic/components/assistive-touch/assistive-popover/assistive-popover.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Component } from '@angular/core'; | ||
import { IonicPage } from '../../../../../../../navigation/ionic-page'; | ||
import { AssistiveTouchProvider } from '../../../providers/assistive-touch/assistive-touch'; | ||
import { ViewController } from '../../../../../../../navigation/view-controller'; | ||
import { Platform } from '../../../../../../../platform/platform'; | ||
|
||
@IonicPage() | ||
@Component({ | ||
templateUrl: 'assistive-popover.html' | ||
}) | ||
export class AssistivePopover { | ||
constructor(private assistive: AssistiveTouchProvider, | ||
private plt: Platform, | ||
private viewCtrl: ViewController) {} | ||
|
||
homeButton() { | ||
this.assistive.closeButton.emit(); | ||
this.close(); | ||
} | ||
|
||
flipDirection() { | ||
this.plt.setDir(this.plt.dir() === 'ltr' ? 'rtl' : 'ltr', true); | ||
this.close(); | ||
} | ||
|
||
private close() { | ||
this.viewCtrl.dismiss(); | ||
} | ||
} |
6 changes: 2 additions & 4 deletions
6
src/components/snapshot/test/basic/components/assistive-touch/assistive-touch.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters