|
|
@@ -1,15 +1,15 @@
|
|
|
import {ElementRef} from '@angular/core';
|
|
|
-import {getSize} from './size';
|
|
|
-import extend from 'lodash/extend';
|
|
|
+import extend from 'lodash-es/extend';
|
|
|
import {IncrementalStackManager} from '@ex-helpers/stack';
|
|
|
+import {bounds} from './bounds';
|
|
|
|
|
|
declare module '@angular/core' {
|
|
|
- class ElementRef {
|
|
|
+ class ElementRef<T = any> {
|
|
|
private _watchSizeCollection: any;
|
|
|
|
|
|
- nativeElement: any;
|
|
|
+ nativeElement: T;
|
|
|
|
|
|
- constructor(nativeElement: any);
|
|
|
+ constructor(nativeElement: T);
|
|
|
|
|
|
watchSize: (callback: (height: number, width: number) => void,
|
|
|
options?: { attributes: boolean, childList: boolean, characterData: boolean },
|
|
|
@@ -53,7 +53,7 @@ ElementRef.prototype.watchSize = function
|
|
|
let lastHeight: number;
|
|
|
let lastWidth: number;
|
|
|
const triggerCheck = () => {
|
|
|
- const sizes = getSize(this.nativeElement);
|
|
|
+ const sizes = bounds(this.nativeElement).size;
|
|
|
if (lastWidth === sizes.width && lastHeight === sizes.height) {
|
|
|
return;
|
|
|
}
|