4
0
Эх сурвалжийг харах

feature: Removed unimplemented CSS rules from config, but added ID for buttons to allow for easy theming (#255)

James Read 2 жил өмнө
parent
commit
709223bd46

+ 0 - 2
internal/config/config.go

@@ -8,7 +8,6 @@ type Action struct {
 	Icon                   string
 	Icon                   string
 	Shell                  string
 	Shell                  string
 	ShellAfterCompleted    string
 	ShellAfterCompleted    string
-	CSS                    map[string]string `mapstructure:"omitempty"`
 	Timeout                int
 	Timeout                int
 	Acls                   []string
 	Acls                   []string
 	Entity                 string
 	Entity                 string
@@ -48,7 +47,6 @@ type EntityFile struct {
 	File string
 	File string
 	Name string
 	Name string
 	Icon string
 	Icon string
-	CSS  map[string]string
 }
 }
 
 
 // PermissionsList defines what users can do with an action.
 // PermissionsList defines what users can do with an action.

+ 3 - 2
webui.dev/js/ActionButton.js

@@ -31,6 +31,9 @@ class ActionButton extends ExecutionFeedbackButton {
 
 
     // DOM Attributes
     // DOM Attributes
     this.setAttribute('role', 'none')
     this.setAttribute('role', 'none')
+    this.setAttribute('id', 'actionButton-' + 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 = () => {
       if (json.arguments.length > 0) {
       if (json.arguments.length > 0) {
@@ -56,8 +59,6 @@ class ActionButton extends ExecutionFeedbackButton {
 
 
     this.domTitle.innerText = this.btn.title
     this.domTitle.innerText = this.btn.title
     this.domIcon.innerHTML = this.unicodeIcon
     this.domIcon.innerHTML = this.unicodeIcon
-
-    this.setAttribute('id', 'actionButton-' + this.actionId)
   }
   }
 
 
   updateFromJson (json) {
   updateFromJson (json) {