Merge branch 'navigate_prev_state_with_update' of github.com:engix-ltd/thingsboard into engix-ltd-navigate_prev_state_with_update
This commit is contained in:
commit
092fadde05
@ -168,10 +168,15 @@ export class DefaultStateControllerComponent extends StateControllerComponent im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public navigatePrevState(index: number): void {
|
public navigatePrevState(index: number, params?: StateParams): void {
|
||||||
if (index < this.stateObject.length - 1) {
|
let lastIndex: number = this.stateObject.length - 1;
|
||||||
this.stateObject.splice(index + 1, this.stateObject.length - index - 1);
|
if (index < lastIndex) {
|
||||||
this.gotoState(this.stateObject[this.stateObject.length - 1].id, true);
|
this.stateObject.splice(index + 1, lastIndex - 1);
|
||||||
|
lastIndex = this.stateObject.length - 1;
|
||||||
|
if (params) {
|
||||||
|
this.stateObject[lastIndex].params = params;
|
||||||
|
}
|
||||||
|
this.gotoState(this.stateObject[lastIndex].id, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -195,11 +195,14 @@ export class EntityStateControllerComponent extends StateControllerComponent imp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public navigatePrevState(index: number): void {
|
public navigatePrevState(index: number, params?: StateParams): void {
|
||||||
if (index < this.stateObject.length - 1) {
|
if (index < this.stateObject.length - 1) {
|
||||||
this.stateObject.splice(index + 1, this.stateObject.length - index - 1);
|
this.stateObject.splice(index + 1, this.stateObject.length - index - 1);
|
||||||
this.selectedStateIndex = this.stateObject.length - 1;
|
this.selectedStateIndex = this.stateObject.length - 1;
|
||||||
this.gotoState(this.stateObject[this.stateObject.length - 1].id, true);
|
if (params) {
|
||||||
|
this.stateObject[this.selectedStateIndex].params = params;
|
||||||
|
}
|
||||||
|
this.gotoState(this.stateObject[this.selectedStateIndex].id, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -199,7 +199,7 @@ export abstract class StateControllerComponent implements IStateControllerCompon
|
|||||||
|
|
||||||
public abstract getStateParamsByStateId(stateId: string): StateParams;
|
public abstract getStateParamsByStateId(stateId: string): StateParams;
|
||||||
|
|
||||||
public abstract navigatePrevState(index: number): void;
|
public abstract navigatePrevState(index: number, params?: StateParams): void;
|
||||||
|
|
||||||
public abstract openState(id: string, params?: StateParams, openRightLayout?: boolean): void;
|
public abstract openState(id: string, params?: StateParams, openRightLayout?: boolean): void;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user