Просмотр исходного кода

feature: Argument labels will end with a :, unless they end with ?, : or . already (#355)

James Read 2 лет назад
Родитель
Сommit
20c4423799
1 измененных файлов с 9 добавлено и 1 удалено
  1. 9 1
      webui.dev/js/ArgumentForm.js

+ 9 - 1
webui.dev/js/ArgumentForm.js

@@ -74,7 +74,15 @@ class ArgumentForm extends window.HTMLElement {
 
   createDomLabel (arg) {
     const domLbl = document.createElement('label')
-    domLbl.innerText = arg.title + ':'
+
+    const lastChar = arg.title.charAt(arg.title.length - 1)
+
+    if (lastChar === '?' || lastChar === '.' || lastChar === ':') {
+      domLbl.innerHTML = arg.title
+    } else {
+      domLbl.innerHTML = arg.title + ':'
+    }
+
     domLbl.setAttribute('for', arg.name)
 
     return domLbl