From a522fb3822e6e4eff15e3688cce5b8014f2eef73 Mon Sep 17 00:00:00 2001 From: mustafahlvc Date: Mon, 14 Aug 2017 16:15:19 +0300 Subject: [PATCH] (fuseIfOndDom) function changed for ie + new polyfills added and activated. --- .editorconfig | 1 - package-lock.json | 15 ++++++ package.json | 7 ++- .../fuse-if-on-dom.directive.ts | 4 +- src/polyfills.ts | 49 +++++++++++-------- 5 files changed, 50 insertions(+), 26 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6e87a003..ff9b6fc9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,3 @@ -# Editor configuration, see http://editorconfig.org root = true [*] diff --git a/package-lock.json b/package-lock.json index ffb9f209..0b158201 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1260,6 +1260,11 @@ } } }, + "classlist.js": { + "version": "1.1.20150312", + "resolved": "https://registry.npmjs.org/classlist.js/-/classlist.js-1.1.20150312.tgz", + "integrity": "sha1-HXCEL3Ai8I2awIbOaeWyUPLFd4k=" + }, "clean-css": { "version": "4.1.7", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.7.tgz", @@ -3948,6 +3953,11 @@ "integrity": "sha1-y8NcYu7uc/Gat7EKgBURQBr8D5A=", "dev": true }, + "intl": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/intl/-/intl-1.2.5.tgz", + "integrity": "sha1-giRKIZDE5Bn4Nx9ao02qNCDiq94=" + }, "invariant": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", @@ -8261,6 +8271,11 @@ "minimalistic-assert": "1.0.0" } }, + "web-animations-js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/web-animations-js/-/web-animations-js-2.3.1.tgz", + "integrity": "sha1-Om2bwVGWN3qQ+OKAP6UmIWWwRRA=" + }, "webdriver-js-extender": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-1.0.0.tgz", diff --git a/package.json b/package.json index 6529c6a5..b67351e7 100644 --- a/package.json +++ b/package.json @@ -24,20 +24,23 @@ "@angular/platform-browser": "^4.3.3", "@angular/platform-browser-dynamic": "^4.3.3", "@angular/router": "^4.3.3", + "@swimlane/ngx-charts": "^6.0.1", "@swimlane/ngx-datatable": "^9.3.1", "@swimlane/ngx-dnd": "^2.2.0", "angular-calendar": "^0.19.0", "angular-in-memory-web-api": "^0.3.2", + "classlist.js": "^1.1.20150312", "core-js": "^2.5.0", + "d3": "^4.10.0", "firebase": "^4.2.0", "hammerjs": "^2.0.8", "highlight.js": "^9.12.0", + "intl": "^1.2.5", "moment": "^2.18.1", - "d3": "^4.10.0", - "@swimlane/ngx-charts": "^6.0.1", "ngx-color-picker": "^4.3.0", "ngx-perfect-scrollbar": "^4.5.3", "rxjs": "^5.4.2", + "web-animations-js": "^2.3.1", "zone.js": "^0.8.16" }, "devDependencies": { diff --git a/src/app/core/directives/fuse-if-on-dom/fuse-if-on-dom.directive.ts b/src/app/core/directives/fuse-if-on-dom/fuse-if-on-dom.directive.ts index 1db64417..3854c0f9 100644 --- a/src/app/core/directives/fuse-if-on-dom/fuse-if-on-dom.directive.ts +++ b/src/app/core/directives/fuse-if-on-dom/fuse-if-on-dom.directive.ts @@ -17,14 +17,14 @@ export class FuseIfOnDomDirective implements AfterContentChecked ngAfterContentChecked() { - if ( this.element.nativeElement.isConnected && !this.isCreated ) + if ( document.body.contains(this.element.nativeElement) && !this.isCreated ) { setTimeout(() => { this.viewContainer.createEmbeddedView(this.templateRef); }, 0); this.isCreated = true; } - else if ( this.isCreated && !this.element.nativeElement.isConnected ) + else if ( this.isCreated && !document.body.contains(this.element.nativeElement) ) { this.viewContainer.clear(); this.isCreated = false; diff --git a/src/polyfills.ts b/src/polyfills.ts index fd01cc9f..03076c57 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -19,27 +19,28 @@ */ /** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; +import 'core-js/es6/symbol'; +import 'core-js/es6/object'; +import 'core-js/es6/function'; +import 'core-js/es6/parse-int'; +import 'core-js/es6/parse-float'; +import 'core-js/es6/number'; +import 'core-js/es6/math'; +import 'core-js/es6/string'; +import 'core-js/es6/date'; +import 'core-js/es6/array'; +import 'core-js/es6/regexp'; +import 'core-js/es6/map'; +import 'core-js/es6/weak-map'; +import 'core-js/es6/set'; + +import 'core-js/es7/array'; /** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. +import 'classlist.js'; // Run `npm install --save classlist.js`. /** IE10 and IE11 requires the following to support `@angular/animation`. */ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - +import 'web-animations-js'; // Run `npm install --save web-animations-js`. /** Evergreen browsers require these. **/ import 'core-js/es6/reflect'; @@ -47,7 +48,7 @@ import 'core-js/es7/reflect'; /** ALL Firefox browsers require the following to support `@angular/animation`. **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. +import 'web-animations-js'; // Run `npm install --save web-animations-js`. @@ -57,7 +58,6 @@ import 'core-js/es7/reflect'; import 'zone.js/dist/zone'; // Included with Angular CLI. - /*************************************************************************************************** * APPLICATION IMPORTS */ @@ -66,8 +66,15 @@ import 'zone.js/dist/zone'; // Included with Angular CLI. * Date, currency, decimal and percent pipes. * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 */ -// import 'intl'; // Run `npm install --save intl`. +import 'intl'; // Run `npm install --save intl`. /** * Need to import at least one locale-data with intl. */ -// import 'intl/locale-data/jsonp/en'; +import 'intl/locale-data/jsonp/en'; + +/** + * Fix for ngx-chart to work on ie11 + */ +if (typeof SVGElement.prototype.contains === 'undefined') { + SVGElement.prototype.contains = HTMLDivElement.prototype.contains; +}