kui-shell
Version:
This is the monorepo for Kui, the hybrid command-line/GUI electron-based Kubernetes tool
31 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function rightButtonContainer() {
return document.getElementById('kui--custom-top-tab-stripe-button-container');
}
function buttonExists(designation) {
return rightButtonContainer().querySelector(`.${designation}`) !== null;
}
exports.buttonExists = buttonExists;
function removeIcon(designation) {
const button = rightButtonContainer().querySelector(`.${designation}`);
if (button) {
rightButtonContainer().removeChild(button);
}
}
exports.removeIcon = removeIcon;
function addIcon(image, designation, position = 'prepend') {
const button = document.createElement('div');
button.className = 'left-tab-stripe-button smaller-button';
button.classList.add(designation);
button.appendChild(image);
if (position === 'append') {
rightButtonContainer().appendChild(button);
}
else {
rightButtonContainer().prepend(button);
}
return button;
}
exports.addIcon = addIcon;
//# sourceMappingURL=top-tabs.js.map