mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 04:25:08 +00:00
(FuseConfig) Only reset the layout object on route changes
This commit is contained in:
parent
962df7fe9a
commit
498b9647e6
|
@ -93,15 +93,18 @@ export class FuseConfigService
|
||||||
// Set the config from the default config
|
// Set the config from the default config
|
||||||
this._configSubject = new BehaviorSubject(_.cloneDeep(this._defaultConfig));
|
this._configSubject = new BehaviorSubject(_.cloneDeep(this._defaultConfig));
|
||||||
|
|
||||||
// Reload the default config on every RoutesRecognized event if
|
// Reload the default layout config on every RoutesRecognized event
|
||||||
// the current config is different from the default one
|
// if the current layout config is different from the default one
|
||||||
this._router.events
|
this._router.events
|
||||||
.pipe(filter(event => event instanceof RoutesRecognized))
|
.pipe(filter(event => event instanceof RoutesRecognized))
|
||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
if ( !_.isEqual(this._configSubject.getValue(), this._defaultConfig) )
|
if ( !_.isEqual(this._configSubject.getValue().layout, this._defaultConfig.layout) )
|
||||||
{
|
{
|
||||||
// Clone the default config
|
// Clone the current config
|
||||||
const config = _.cloneDeep(this._defaultConfig);
|
const config = _.cloneDeep(this._configSubject.getValue());
|
||||||
|
|
||||||
|
// Reset the layout from the default config
|
||||||
|
config.layout = _.cloneDeep(this._defaultConfig.layout);
|
||||||
|
|
||||||
// Set the config
|
// Set the config
|
||||||
this._configSubject.next(config);
|
this._configSubject.next(config);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
export interface FuseConfig
|
export interface FuseConfig
|
||||||
{
|
{
|
||||||
colorTheme: string;
|
colorTheme: string;
|
||||||
|
customScrollbars: boolean;
|
||||||
layout: {
|
layout: {
|
||||||
style: string,
|
style: string,
|
||||||
width: 'fullwidth' | 'boxed',
|
width: 'fullwidth' | 'boxed',
|
||||||
|
@ -29,5 +30,4 @@ export interface FuseConfig
|
||||||
position: 'left' | 'right'
|
position: 'left' | 'right'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
customScrollbars: boolean;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { FuseConfig } from '@fuse/types';
|
||||||
export const fuseConfig: FuseConfig = {
|
export const fuseConfig: FuseConfig = {
|
||||||
// Color themes can be defined in src/app/app.theme.scss
|
// Color themes can be defined in src/app/app.theme.scss
|
||||||
colorTheme : 'theme-default',
|
colorTheme : 'theme-default',
|
||||||
|
customScrollbars: true,
|
||||||
layout : {
|
layout : {
|
||||||
style : 'vertical-layout-1',
|
style : 'vertical-layout-1',
|
||||||
width : 'fullwidth',
|
width : 'fullwidth',
|
||||||
|
@ -38,6 +39,5 @@ export const fuseConfig: FuseConfig = {
|
||||||
hidden : false,
|
hidden : false,
|
||||||
position: 'right'
|
position: 'right'
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
customScrollbars: true
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user