Minor UI fixes
This commit is contained in:
parent
28d48933f2
commit
00e7779f71
@ -492,8 +492,8 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo
|
|||||||
const parentHeight = this.gridster.el.offsetHeight;
|
const parentHeight = this.gridster.el.offsetHeight;
|
||||||
if (this.isMobileSize && this.mobileAutofillHeight && parentHeight) {
|
if (this.isMobileSize && this.mobileAutofillHeight && parentHeight) {
|
||||||
this.updateMobileOpts(parentHeight);
|
this.updateMobileOpts(parentHeight);
|
||||||
this.notifyGridsterOptionsChanged();
|
|
||||||
}
|
}
|
||||||
|
this.notifyGridsterOptionsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateLayoutOpts() {
|
private updateLayoutOpts() {
|
||||||
|
|||||||
@ -84,9 +84,6 @@ export class DateRangeNavigatorWidgetComponent extends PageComponent implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.dashboardTimewindowChangedSubscription = this.ctx.dashboard.dashboardTimewindowChanged.subscribe(() => {
|
|
||||||
this.widgetContextTimewindowSync();
|
|
||||||
});
|
|
||||||
this.settings = this.ctx.settings;
|
this.settings = this.ctx.settings;
|
||||||
this.settings.useSessionStorage = isDefined(this.settings.useSessionStorage) ? this.settings.useSessionStorage : true;
|
this.settings.useSessionStorage = isDefined(this.settings.useSessionStorage) ? this.settings.useSessionStorage : true;
|
||||||
let selection;
|
let selection;
|
||||||
@ -110,6 +107,9 @@ export class DateRangeNavigatorWidgetComponent extends PageComponent implements
|
|||||||
}
|
}
|
||||||
this.selectedStepSize = this.datesMap[this.settings.stepSize || 'day'].ts;
|
this.selectedStepSize = this.datesMap[this.settings.stepSize || 'day'].ts;
|
||||||
this.widgetContextTimewindowSync();
|
this.widgetContextTimewindowSync();
|
||||||
|
this.dashboardTimewindowChangedSubscription = this.ctx.dashboard.dashboardTimewindowChanged.subscribe(() => {
|
||||||
|
this.widgetContextTimewindowSync();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
|||||||
@ -474,7 +474,8 @@ export class DashboardWidget implements GridsterItem, IDashboardWidget {
|
|||||||
if (mobileHeight) {
|
if (mobileHeight) {
|
||||||
res = mobileHeight;
|
res = mobileHeight;
|
||||||
} else {
|
} else {
|
||||||
res = this.widget.sizeY * 24 / this.dashboard.gridsterOpts.minCols;
|
const sizeY = this.widgetLayout ? this.widgetLayout.sizeY : this.widget.sizeY;
|
||||||
|
res = sizeY * 24 / this.dashboard.gridsterOpts.minCols;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.widgetLayout) {
|
if (this.widgetLayout) {
|
||||||
|
|||||||
@ -15,7 +15,6 @@
|
|||||||
///
|
///
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ChangeDetectionStrategy,
|
|
||||||
Component,
|
Component,
|
||||||
ElementRef,
|
ElementRef,
|
||||||
forwardRef,
|
forwardRef,
|
||||||
@ -106,6 +105,8 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato
|
|||||||
|
|
||||||
private propagateChange = null;
|
private propagateChange = null;
|
||||||
private propagateChangePending = false;
|
private propagateChangePending = false;
|
||||||
|
private writingValue = false;
|
||||||
|
private updateViewPending = false;
|
||||||
|
|
||||||
constructor(public elementRef: ElementRef,
|
constructor(public elementRef: ElementRef,
|
||||||
private translate: TranslateService,
|
private translate: TranslateService,
|
||||||
@ -143,6 +144,7 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato
|
|||||||
}
|
}
|
||||||
|
|
||||||
writeValue(data: JsonFormComponentData): void {
|
writeValue(data: JsonFormComponentData): void {
|
||||||
|
this.writingValue = true;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
this.schema = this.data && this.data.schema ? deepClone(this.data.schema) : {
|
this.schema = this.data && this.data.schema ? deepClone(this.data.schema) : {
|
||||||
type: 'object'
|
type: 'object'
|
||||||
@ -154,19 +156,29 @@ export class JsonFormComponent implements OnInit, ControlValueAccessor, Validato
|
|||||||
this.model = inspector.sanitize(this.schema, this.model).data;
|
this.model = inspector.sanitize(this.schema, this.model).data;
|
||||||
this.updateAndRender();
|
this.updateAndRender();
|
||||||
this.isModelValid = this.validateModel();
|
this.isModelValid = this.validateModel();
|
||||||
if (!this.isModelValid) {
|
this.writingValue = false;
|
||||||
|
if (!this.isModelValid || this.updateViewPending) {
|
||||||
this.updateView();
|
this.updateView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateView() {
|
updateView() {
|
||||||
if (this.data) {
|
if (!this.writingValue) {
|
||||||
this.data.model = this.model;
|
this.updateViewPending = false;
|
||||||
if (this.propagateChange) {
|
if (this.data) {
|
||||||
this.propagateChange(this.data);
|
this.data.model = this.model;
|
||||||
} else {
|
if (this.propagateChange) {
|
||||||
this.propagateChangePending = true;
|
try {
|
||||||
|
this.propagateChange(this.data);
|
||||||
|
} catch (e) {
|
||||||
|
this.propagateChangePending = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.propagateChangePending = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.updateViewPending = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user