mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-07 12:33:03 +03:00
parent
3009d18b39
commit
2ebca4bb03
|
@ -146,6 +146,7 @@ ReDoc makes use of the following [vendor extensions](http://swagger.io/specifica
|
||||||
* `required-props-first` - show required properties first ordered in the same order as in `required` array.
|
* `required-props-first` - show required properties first ordered in the same order as in `required` array.
|
||||||
* `no-auto-auth` - do not inject Authentication section automatically
|
* `no-auto-auth` - do not inject Authentication section automatically
|
||||||
* `path-in-middle-panel` - show path link and HTTP verb in the middle panel instead of the right one
|
* `path-in-middle-panel` - show path link and HTTP verb in the middle panel instead of the right one
|
||||||
|
* `hide-loading` - do not show loading animation. Useful for small docs
|
||||||
|
|
||||||
## Advanced usage
|
## Advanced usage
|
||||||
Instead of adding `spec-url` attribute to the `<redoc>` element you can initialize ReDoc via globally exposed `Redoc` object:
|
Instead of adding `spec-url` attribute to the `<redoc>` element you can initialize ReDoc via globally exposed `Redoc` object:
|
||||||
|
|
|
@ -89,6 +89,9 @@ export class Redoc extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
hideLoadingAnimation() {
|
hideLoadingAnimation() {
|
||||||
|
if (this.options.hideLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
this.specLoadingRemove = true;
|
this.specLoadingRemove = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -99,6 +102,9 @@ export class Redoc extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
showLoadingAnimation() {
|
showLoadingAnimation() {
|
||||||
|
if (this.options.hideLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.specLoading = true;
|
this.specLoading = true;
|
||||||
this.specLoadingRemove = false;
|
this.specLoadingRemove = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,8 @@ const OPTION_NAMES = new Set([
|
||||||
'requiredPropsFirst',
|
'requiredPropsFirst',
|
||||||
'noAutoAuth',
|
'noAutoAuth',
|
||||||
'pathInMiddlePanel',
|
'pathInMiddlePanel',
|
||||||
'untrustedSpec'
|
'untrustedSpec',
|
||||||
|
'hideLoading'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export interface Options {
|
export interface Options {
|
||||||
|
@ -35,6 +36,7 @@ export interface Options {
|
||||||
noAutoAuth?: boolean;
|
noAutoAuth?: boolean;
|
||||||
pathInMiddlePanel?: boolean;
|
pathInMiddlePanel?: boolean;
|
||||||
untrustedSpec?: boolean;
|
untrustedSpec?: boolean;
|
||||||
|
hideLoading?: boolean;
|
||||||
spec?: any;
|
spec?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,6 +106,7 @@ export class OptionsService {
|
||||||
if (isString(this._options.noAutoAuth)) this._options.noAutoAuth = true;
|
if (isString(this._options.noAutoAuth)) this._options.noAutoAuth = true;
|
||||||
if (isString(this._options.pathInMiddlePanel)) this._options.pathInMiddlePanel = true;
|
if (isString(this._options.pathInMiddlePanel)) this._options.pathInMiddlePanel = true;
|
||||||
if (isString(this._options.untrustedSpec)) this._options.untrustedSpec = true;
|
if (isString(this._options.untrustedSpec)) this._options.untrustedSpec = true;
|
||||||
|
if (isString(this._options.hideLoading)) this._options.hideLoading = true;
|
||||||
if (isString(this._options.expandResponses)) {
|
if (isString(this._options.expandResponses)) {
|
||||||
let str = this._options.expandResponses as string;
|
let str = this._options.expandResponses as string;
|
||||||
if (str === 'all') return;
|
if (str === 'all') return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user