MCPcopy
hub / github.com/DevCloudFE/ng-devui / ngOnInit

Method ngOnInit

devui/splitter/splitter-bar.component.ts:107–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

105 }
106
107 ngOnInit(): void {
108 let state;
109 const resizeListener = this.resize.pressEvent
110 .pipe(
111 tap(this.stopPropagation),
112 filter(() => this.splitter.isResizable(this.index)),
113 tap(() => {
114 state = this.splitter.dragState(this.index);
115 }),
116 switchMap(this.moveStream(this.resize))
117 )
118 .subscribe(({ pageX, pageY, originalX, originalY }) => {
119 let distance;
120 if (this.orientation === 'vertical') {
121 distance = pageY - originalY;
122 } else {
123 distance = pageX - originalX;
124 }
125 this.splitter.setSize(state, distance);
126 });
127 this.subscriptions.add(resizeListener);
128 }
129
130 ngAfterViewInit(): void {
131 this.initialCollapseStatus();

Callers

nothing calls this directly

Calls 5

subscribeMethod · 0.80
isResizableMethod · 0.80
dragStateMethod · 0.80
setSizeMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected