Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
relayout() {
var {urlInput, loadButton, saveButton, removeButton, contentText} = this.ui;
urlInput.width = contentText.width = this.width;
urlInput.top = 0;
urlInput.height = 20;
var oneThird = this.width/3;
loadButton.extent = saveButton.extent = removeButton.extent = pt(oneThird, 20);
loadButton.topLeft = urlInput.bottomLeft;
saveButton.topLeft = loadButton.topRight;
removeButton.topLeft = saveButton.topRight;
contentText.topLeft = loadButton.bottomLeft;
contentText.height = this.height - loadButton.bottom;
}
computeMinContainerExtent(spacing, container, layoutableSubmorphs) {
var spacingWidth = (layoutableSubmorphs.length + 1) * spacing;
var maxW = 0, maxH = 0;
for (var i = 0; i < layoutableSubmorphs.length; i++) {
let m = layoutableSubmorphs[i],
{x: w, y: h} = m.extent;
maxW += w;
maxH = Math.max(h, maxH);
}
return pt(maxW + spacingWidth, maxH)
}