mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-09 20:15:07 +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
|
||||
this._configSubject = new BehaviorSubject(_.cloneDeep(this._defaultConfig));
|
||||
|
||||
// Reload the default config on every RoutesRecognized event if
|
||||
// the current config is different from the default one
|
||||
// Reload the default layout config on every RoutesRecognized event
|
||||
// if the current layout config is different from the default one
|
||||
this._router.events
|
||||
.pipe(filter(event => event instanceof RoutesRecognized))
|
||||
.subscribe(() => {
|
||||
if ( !_.isEqual(this._configSubject.getValue(), this._defaultConfig) )
|
||||
if ( !_.isEqual(this._configSubject.getValue().layout, this._defaultConfig.layout) )
|
||||
{
|
||||
// Clone the default config
|
||||
const config = _.cloneDeep(this._defaultConfig);
|
||||
// Clone the current config
|
||||
const config = _.cloneDeep(this._configSubject.getValue());
|
||||
|
||||
// Reset the layout from the default config
|
||||
config.layout = _.cloneDeep(this._defaultConfig.layout);
|
||||
|
||||
// Set the config
|
||||
this._configSubject.next(config);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
export interface FuseConfig
|
||||
{
|
||||
colorTheme: string;
|
||||
customScrollbars: boolean;
|
||||
layout: {
|
||||
style: string,
|
||||
width: 'fullwidth' | 'boxed',
|
||||
|
@ -29,5 +30,4 @@ export interface FuseConfig
|
|||
position: 'left' | 'right'
|
||||
}
|
||||
};
|
||||
customScrollbars: boolean;
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import { FuseConfig } from '@fuse/types';
|
|||
export const fuseConfig: FuseConfig = {
|
||||
// Color themes can be defined in src/app/app.theme.scss
|
||||
colorTheme : 'theme-default',
|
||||
customScrollbars: true,
|
||||
layout : {
|
||||
style : 'vertical-layout-1',
|
||||
width : 'fullwidth',
|
||||
|
@ -38,6 +39,5 @@ export const fuseConfig: FuseConfig = {
|
|||
hidden : false,
|
||||
position: 'right'
|
||||
}
|
||||
},
|
||||
customScrollbars: true
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user