Kaynağa Gözat

bugfix: Default load dashboard when it contains multiple spaces (#318)

James Read 2 yıl önce
ebeveyn
işleme
18423a9888
1 değiştirilmiş dosya ile 4 ekleme ve 2 silme
  1. 4 2
      webui.dev/js/marshaller.js

+ 4 - 2
webui.dev/js/marshaller.js

@@ -97,8 +97,10 @@ function onExecutionFinished (evt) {
 }
 }
 
 
 function showSection (title) {
 function showSection (title) {
+  title = title.replaceAll(' ', '')
+
   for (const section of document.querySelectorAll('section')) {
   for (const section of document.querySelectorAll('section')) {
-    if (section.title.replace(' ', '') === title) {
+    if (section.title === title) {
       section.style.display = 'block'
       section.style.display = 'block'
     } else {
     } else {
       section.style.display = 'none'
       section.style.display = 'none'
@@ -174,7 +176,7 @@ function marshalDashboardStructureToHtml (json) {
     }
     }
 
 
     const section = document.createElement('section')
     const section = document.createElement('section')
-    section.title = dashboard.title
+    section.title = dashboard.title.replaceAll(' ', '')
 
 
     const def = createFieldset('default', section)
     const def = createFieldset('default', section)
     section.appendChild(def)
     section.appendChild(def)