mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
Fix change-detection on Safari/IE
This commit is contained in:
parent
a23008e839
commit
b6a711b25d
|
@ -40,7 +40,7 @@ export default class JsonSchemaLazy {
|
|||
this.dcl.loadNextToLocation(JsonSchema, this.elementRef).then((compRef) => {
|
||||
compRef.instance.pointer = this.pointer;
|
||||
// trigger change detection
|
||||
compRef.location.internalElement.parentView.changeDetector.detectChanges();
|
||||
compRef.hostView.changeDetectorRef.detectChanges();
|
||||
});
|
||||
}
|
||||
this.loaded = true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
import {NgZone, ChangeDetectionStrategy, ElementRef} from 'angular2/core';
|
||||
import {ChangeDetectorRef, ChangeDetectionStrategy, ElementRef} from 'angular2/core';
|
||||
import {document} from 'angular2/src/facade/browser';
|
||||
import {BrowserDomAdapter} from 'angular2/platform/browser';
|
||||
import {global} from 'angular2/src/facade/lang';
|
||||
|
@ -28,19 +28,16 @@ const INVIEW_POSITION = {
|
|||
changeDetection: ChangeDetectionStrategy.Default
|
||||
})
|
||||
@Reflect.metadata('parameters', [[SchemaManager], [ElementRef],
|
||||
[BrowserDomAdapter], [NgZone], OptionsManager])
|
||||
[BrowserDomAdapter], [ChangeDetectorRef], [OptionsManager]])
|
||||
export default class SideMenu extends BaseComponent {
|
||||
constructor(schemaMgr, elementRef, dom, zone, optionsMgr) {
|
||||
constructor(schemaMgr, elementRef, dom, changeDetectorRef, optionsMgr) {
|
||||
super(schemaMgr);
|
||||
this.$element = elementRef.nativeElement;
|
||||
this.changeDetector = changeDetectorRef;
|
||||
this.dom = dom;
|
||||
this.options = optionsMgr.options;
|
||||
this.$scrollParent = this.options.$scrollParent;
|
||||
// for some reason constructor is not run inside zone
|
||||
// as workaround running it manually
|
||||
zone.run(() => {
|
||||
this.bindEvents();
|
||||
});
|
||||
this.bindEvents();
|
||||
this.activeCatIdx = 0;
|
||||
this.activeMethodIdx = -1;
|
||||
this.prevOffsetY = null;
|
||||
|
@ -221,6 +218,7 @@ export default class SideMenu extends BaseComponent {
|
|||
}
|
||||
stable = true;
|
||||
}
|
||||
this.changeDetector.detectChanges();
|
||||
}
|
||||
|
||||
prepareModel() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user