Code duplication cleanup after last commit
This commit is contained in:
@@ -10,16 +10,6 @@
|
||||
|
||||
const printOutput = (e: HTMLElement, d: PrintData): void => print(e, d);
|
||||
|
||||
function getWidth() {
|
||||
const e = document.getElementById('cout');
|
||||
if(!e){
|
||||
throw new Error('cant get width of the teminal element. Its null');
|
||||
}
|
||||
const padding: number = parseInt(window.getComputedStyle(e, null).getPropertyValue('padding').slice(0, -2));
|
||||
console.log(padding);
|
||||
return e.clientWidth - (padding * 2);
|
||||
}
|
||||
|
||||
function updateTerminal() {
|
||||
username = terminal!.getUser().username;
|
||||
cwd = terminal!.getCwd();
|
||||
|
||||
Reference in New Issue
Block a user