Skip to content

Commit 6191620

Browse files
committed
updated popup window title Issue #38
1 parent a4c120d commit 6191620

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

html/classhelper.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,16 @@ class ClassHelper extends HTMLElement {
895895
const doc = event.target;
896896
const body = doc.body;
897897

898+
const itemDesignator = window.location.pathname.split("/").at(-1);
899+
let title = `${itemDesignator} - Classhelper`;
900+
901+
if (props.formProperty) {
902+
const label = document.getElementsByName(props.formProperty).item(0).parentElement.previousElementSibling;
903+
title = label.textContent + " - " + title;
904+
}
905+
906+
doc.title = title;
907+
898908
// Add external classhelper stylesheet to head
899909
const styleSheet = doc.createElement("link");
900910
styleSheet.rel = "stylesheet";

0 commit comments

Comments
 (0)