mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	fix(client): allow overriding position using getter (closes #1321)
This commit is contained in:
		@@ -18,7 +18,7 @@ export class TypedComponent<ChildT extends TypedComponent<ChildT>> {
 | 
				
			|||||||
    children: ChildT[];
 | 
					    children: ChildT[];
 | 
				
			||||||
    initialized: Promise<void> | null;
 | 
					    initialized: Promise<void> | null;
 | 
				
			||||||
    parent?: TypedComponent<any>;
 | 
					    parent?: TypedComponent<any>;
 | 
				
			||||||
    position!: number;
 | 
					    _position!: number;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    constructor() {
 | 
					    constructor() {
 | 
				
			||||||
        this.componentId = `${this.sanitizedClassName}-${utils.randomString(8)}`;
 | 
					        this.componentId = `${this.sanitizedClassName}-${utils.randomString(8)}`;
 | 
				
			||||||
@@ -31,6 +31,14 @@ export class TypedComponent<ChildT extends TypedComponent<ChildT>> {
 | 
				
			|||||||
        return this.constructor.name.replace(/[^A-Z0-9]/gi, "_");
 | 
					        return this.constructor.name.replace(/[^A-Z0-9]/gi, "_");
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    get position() {
 | 
				
			||||||
 | 
					        return this._position;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    set position(newPosition: number) {
 | 
				
			||||||
 | 
					        this._position = newPosition;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    setParent(parent: TypedComponent<any>) {
 | 
					    setParent(parent: TypedComponent<any>) {
 | 
				
			||||||
        this.parent = parent;
 | 
					        this.parent = parent;
 | 
				
			||||||
        return this;
 | 
					        return this;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user