Fix setting 'Margin beetween widgets' set 0
This commit is contained in:
		
							parent
							
								
									0064e1d115
								
							
						
					
					
						commit
						55a949b6d9
					
				@ -275,7 +275,7 @@ export class DashboardUtilsService {
 | 
			
		||||
      layout.gridSettings.margin = layout.gridSettings.margins[0];
 | 
			
		||||
      delete layout.gridSettings.margins;
 | 
			
		||||
    }
 | 
			
		||||
    layout.gridSettings.margin = layout.gridSettings.margin || 10;
 | 
			
		||||
    layout.gridSettings.margin = isDefined(layout.gridSettings.margin) ? layout.gridSettings.margin : 10;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public setLayouts(dashboard: Dashboard, targetState: string, newLayouts: DashboardStateLayouts) {
 | 
			
		||||
 | 
			
		||||
@ -196,7 +196,7 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo
 | 
			
		||||
      maxItemRows: 1000,
 | 
			
		||||
      maxItemArea: 1000000,
 | 
			
		||||
      outerMargin: true,
 | 
			
		||||
      margin: this.margin ? this.margin : 10,
 | 
			
		||||
      margin: isDefined(this.margin) ? this.margin : 10,
 | 
			
		||||
      minItemCols: 1,
 | 
			
		||||
      minItemRows: 1,
 | 
			
		||||
      defaultItemCols: 8,
 | 
			
		||||
@ -495,7 +495,7 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo
 | 
			
		||||
 | 
			
		||||
  private updateLayoutOpts() {
 | 
			
		||||
    this.gridsterOpts.minCols = this.columns ? this.columns : 24;
 | 
			
		||||
    this.gridsterOpts.margin = this.margin ? this.margin : 10;
 | 
			
		||||
    this.gridsterOpts.margin = isDefined(this.margin) ? this.margin : 10;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private updateEditingOpts() {
 | 
			
		||||
 | 
			
		||||
@ -25,7 +25,7 @@ import { DialogComponent } from '@app/shared/components/dialog.component';
 | 
			
		||||
import { UtilsService } from '@core/services/utils.service';
 | 
			
		||||
import { TranslateService } from '@ngx-translate/core';
 | 
			
		||||
import { DashboardSettings, GridSettings, StateControllerId } from '@app/shared/models/dashboard.models';
 | 
			
		||||
import { isUndefined } from '@core/utils';
 | 
			
		||||
import { isDefined, isUndefined } from '@core/utils';
 | 
			
		||||
import { DashboardUtilsService } from '@core/services/dashboard-utils.service';
 | 
			
		||||
import { StatesControllerService } from './states/states-controller.service';
 | 
			
		||||
 | 
			
		||||
@ -96,7 +96,8 @@ export class DashboardSettingsDialogComponent extends DialogComponent<DashboardS
 | 
			
		||||
      this.gridSettingsFormGroup = this.fb.group({
 | 
			
		||||
        color: [this.gridSettings.color || 'rgba(0,0,0,0.870588)', []],
 | 
			
		||||
        columns: [this.gridSettings.columns || 24, [Validators.required, Validators.min(10), Validators.max(1000)]],
 | 
			
		||||
        margin: [this.gridSettings.margin || 10, [Validators.required, Validators.min(0), Validators.max(50)]],
 | 
			
		||||
        margin: [isDefined(this.gridSettings.margin) ? this.gridSettings.margin : 10,
 | 
			
		||||
          [Validators.required, Validators.min(0), Validators.max(50)]],
 | 
			
		||||
        autoFillHeight: [isUndefined(this.gridSettings.autoFillHeight) ? false : this.gridSettings.autoFillHeight, []],
 | 
			
		||||
        backgroundColor: [this.gridSettings.backgroundColor || 'rgba(0,0,0,0)', []],
 | 
			
		||||
        backgroundImageUrl: [this.gridSettings.backgroundImageUrl, []],
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user