1- import { ChangeDetectionStrategy , Component , ViewChild } from '@angular/core'
2- import { IOutputData , SplitComponent } from 'angular-split'
3-
1+ import { ChangeDetectionStrategy , Component } from '@angular/core'
42import { AComponent } from '../../ui/components/AComponent'
53
64@Component ( {
@@ -9,72 +7,34 @@ import { AComponent } from '../../ui/components/AComponent'
97 host : {
108 class : 'split-example-page' ,
119 } ,
12- styles : [
13- `
14- .as-split-area > div {
15- position: relative;
16- height: 100%;
17- overflow: hidden;
18- }
19-
20- .hack-iframe-hider {
21- background: rgba(0, 0, 0, 0.2);
22- position: absolute;
23- top: 0;
24- left: 0;
25- width: 100%;
26- height: 100%;
27- }
28- ` ,
29- ] ,
3010 template : `
3111 {{ testChangeDetectorRun() }}
3212 <div class="container">
3313 <sp-example-title [type]="exampleEnum.IFRAME"></sp-example-title>
3414 <div class="split-example" style="height: 400px;">
35- <as-split
36- #split
37- direction="horizontal"
38- (dragStart)="dragStartHandler($event)"
39- (dragEnd)="dragEndHandler($event)"
40- (gutterClick)="splitGutterClick($event)"
41- >
15+ <as-split #split direction="horizontal">
4216 <as-split-area size="40">
43- <div>
44- <iframe src="https://angular-split.github.io" frameborder="0" width="100%" height="100%"></iframe>
45- <div [hidden]="showIframeHider === false" class="hack-iframe-hider"></div>
46- </div>
17+ <iframe
18+ src="https://angular-split.github.io"
19+ frameborder="0"
20+ scrolling="no"
21+ width="100%"
22+ height="100%"
23+ ></iframe>
4724 </as-split-area>
4825 <as-split-area size="60">
49- <div>
50- <iframe src="https://angular-split.github.io" frameborder="0" width="100%" height="100%"></iframe>
51- <div [hidden]="showIframeHider === false" class="hack-iframe-hider"></div>
52- </div>
26+ <iframe
27+ src="https://angular-split.github.io"
28+ frameborder="0"
29+ scrolling="no"
30+ width="100%"
31+ height="100%"
32+ ></iframe>
5333 </as-split-area>
5434 </as-split>
35+ <br />
5536 </div>
5637 </div>
5738 ` ,
5839} )
59- export class IframesComponent extends AComponent {
60- showIframeHider = false
61- @ViewChild ( SplitComponent ) split : SplitComponent
62-
63- dragStartHandler ( $event : IOutputData ) {
64- console . log ( 'dragStartHandler' , { event : $event } )
65- this . showIframeHider = true
66- }
67-
68- dragEndHandler ( $event : IOutputData ) {
69- console . log ( 'dragEndHandler' , { event : $event } )
70- this . showIframeHider = false
71- }
72-
73- splitGutterClick ( { gutterNum } : IOutputData ) {
74- // By default, clicking the gutter without changing position does not trigger the 'dragEnd' event
75- // This can be fixed by manually notifying the component
76- // See issue: https://github.com/angular-split/angular-split/issues/186
77- // TODO: Create custom example for this, and document it
78- this . split . notify ( 'end' , gutterNum )
79- }
80- }
40+ export class IframesComponent extends AComponent { }
0 commit comments