Pārlūkot izejas kodu

bugfix: If a button is disabled in the API, render it disabled [skip ci]

jamesread 1 gadu atpakaļ
vecāks
revīzija
d7814ff6df
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      webui.dev/js/ActionButton.js

+ 4 - 0
webui.dev/js/ActionButton.js

@@ -33,6 +33,10 @@ class ActionButton extends ExecutionFeedbackButton {
     this.setAttribute('role', 'none')
     this.setAttribute('role', 'none')
     this.setAttribute('id', 'actionButton-' + this.actionId)
     this.setAttribute('id', 'actionButton-' + this.actionId)
 
 
+    if (!json.canExec) {
+      this.btn.disabled = true
+    }
+
     this.btn.setAttribute('id', 'actionButtonInner-' + this.actionId)
     this.btn.setAttribute('id', 'actionButtonInner-' + this.actionId)
     this.btn.title = json.title
     this.btn.title = json.title
     this.btn.onclick = () => {
     this.btn.onclick = () => {