Deprecate py-button, py-inputbox, py-box and py-title (#931)

This commit is contained in:
Fábio Rosado
2022-11-14 16:29:28 +00:00
committed by GitHub
parent be9b9f66d3
commit adfa9a9b05
15 changed files with 179 additions and 24 deletions

View File

@@ -111,3 +111,16 @@ export function joinPaths(parts: string[], separator = '/') {
}
return res;
}
export function createDeprecationWarning(msg: string, elementName: string): void {
const banners = document.getElementsByClassName('alert-banner py-warning');
let bannerCount = 0;
for (const banner of banners) {
if (banner.innerHTML.includes(elementName)) {
bannerCount++;
}
}
if (bannerCount == 0) {
_createAlertBanner(msg, "warning");
}
}