Skip to content

Commit 92ce7ce

Browse files
author
Konstantin Dinev
committed
chore(*): some minor fixes
1 parent 6686e2e commit 92ce7ce

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

projects/app-lob/src/app/grid/grid-boston-marathon/grid.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { IgxGridComponent, IgxNumberSummaryOperand, IgxStringFilteringOperand, I
1212
import { Athlete, АthletesData, SpeedDescriptor } from '../../data/athletesData';
1313
import { FormsModule } from '@angular/forms';
1414
import { IgxPreventDocumentScrollDirective } from '../../../../../../src/app/directives/prevent-scroll.directive';
15-
import { NgClass, DecimalPipe } from '@angular/common';
15+
import { NgClass, DecimalPipe, DOCUMENT } from '@angular/common';
1616
import { IgxSparklineCoreModule } from 'igniteui-angular-charts';
1717

1818
@Component({
@@ -78,12 +78,12 @@ export class GridComponent implements OnInit, OnDestroy, AfterViewInit {
7878
return (this.windowWidth && this.windowWidth < 860) || !this.live;
7979
}
8080

81-
constructor(@Inject(IgxOverlayService) public overlayService: IgxOverlayService) {}
81+
constructor(@Inject(IgxOverlayService) public overlayService: IgxOverlayService, @Inject(DOCUMENT) private document: Document) {}
8282
public ngOnInit(): void {
8383
this.currentYear = new Date().getFullYear();
8484
this.localData = АthletesData.slice(0, 30).sort((a, b) => b.TrackProgress - a.TrackProgress);
8585
this.localData.forEach(rec => this.getSpeed(rec));
86-
this.windowWidth = window.innerWidth;
86+
this.windowWidth = this.document.defaultView.innerWidth;
8787
this._timer = setInterval(() => this.ticker(), 1500);
8888
this.overlayService.closing.subscribe((event: OverlayClosingEventArgs) => {
8989
this.showOverlay = false;

projects/app-lob/src/app/index/index.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class IndexComponent implements OnInit, AfterViewInit {
166166
}
167167

168168
public refresh() {
169-
window.dispatchEvent(new Event('resize'));
169+
this.document.defaultView.dispatchEvent(new Event('resize'));
170170
}
171171

172172
private getAllSampleRoutes(basePath: string, appModuleRoutes: Route[], modulesRoutes: any[]): any[] {

src/app/grid/grid-paste/paste-handler.directive.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ export class PasteHandler implements OnInit {
4646
}
4747

4848
public onPaste(eventArgs) {
49-
let data;
50-
const clData = 'clipboardData';
49+
let data;
50+
const clData = 'clipboardData';
5151

52-
// get clipboard data - from window.cliboardData for IE or from the original event's arguments.
53-
if (window[clData]) {
54-
window.event.returnValue = false;
55-
data = window[clData].getData('text');
56-
} else {
57-
data = eventArgs[clData].getData('text/plain');
58-
}
52+
// get clipboard data - from window.cliboardData for IE or from the original event's arguments.
53+
if (window[clData]) {
54+
window.event.returnValue = false;
55+
data = window[clData].getData('text');
56+
} else {
57+
data = eventArgs[clData].getData('text/plain');
58+
}
5959

60-
// process the clipboard data
61-
const processedData = this.processData(data);
60+
// process the clipboard data
61+
const processedData = this.processData(data);
6262

63-
this.dataProcessed.emit(processedData);
63+
this.dataProcessed.emit(processedData);
6464
}
6565

6666
public processData(data) {

0 commit comments

Comments
 (0)