Skip to content

Commit

Permalink
🎨 Format JS with pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo committed May 12, 2022
1 parent 143a88f commit 239f1a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/js/termynal.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ class Termynal {
* Initialise the widget, get lines, clear container and start animation.
*/
init() {
/**
/**
* Calculates width and height of Termynal container.
* If container is empty and lines are dynamically loaded, defaults to browser `auto` or CSS.
*/
*/
const containerStyle = getComputedStyle(this.container);
this.container.style.width = containerStyle.width !== '0px' ?
this.container.style.width = containerStyle.width !== '0px' ?
containerStyle.width : undefined;
this.container.style.minHeight = containerStyle.height !== '0px' ?
this.container.style.minHeight = containerStyle.height !== '0px' ?
containerStyle.height : undefined;

this.container.setAttribute('data-termynal', '');
Expand Down Expand Up @@ -138,7 +138,7 @@ class Termynal {
restart.innerHTML = "restart ↻"
return restart
}

generateFinish() {
const finish = document.createElement('a')
finish.onclick = (e) => {
Expand Down Expand Up @@ -215,7 +215,7 @@ class Termynal {

/**
* Converts line data objects into line elements.
*
*
* @param {Object[]} lineData - Dynamically loaded lines.
* @param {Object} line - Line data object.
* @returns {Element[]} - Array of line elements.
Expand All @@ -231,7 +231,7 @@ class Termynal {

/**
* Helper function for generating attributes string.
*
*
* @param {Object} line - Line data object.
* @returns {string} - String of attributes.
*/
Expand Down

0 comments on commit 239f1a5

Please sign in to comment.