ソースを参照

Resolve "Glitch in configuration logic"

Drew McArthur 2 年 前
コミット
0f1e51dbdf
1 ファイル変更9 行追加7 行削除
  1. 9 7
      assets/js/vue.rules.js

+ 9 - 7
assets/js/vue.rules.js

@@ -594,13 +594,10 @@ const app = Vue.createApp({
        * Add custom config entry to the module
        */
       addConfig() {
-          const k = document.getElementById("newConfigKey").value;
-          const v = document.getElementById("newConfigValue").value;
-          this.editor.module.config[k] = v;
-          document.getElementById("newConfigKey").value =
-              "Configuration";
-          document.getElementById("newConfigValue").value =
-              "Value";
+        const k = document.getElementById("newConfigKey").value;
+        const v = document.getElementById("newConfigValue").value;
+        this.editor.module.config[k] = v;
+        this.resetNewConfigInputs();
       },
       
       /**
@@ -629,8 +626,13 @@ const app = Vue.createApp({
       const module = this.newModule();
       module.name = 'New Module';
       module.config = {};
+      this.resetNewConfigInputs();
       this.addToEditor(module);
     },
+    resetNewConfigInputs() {
+      document.getElementById("newConfigKey").value = "Configuration";
+      document.getElementById("newConfigValue").value = "Value";
+    },
     /**
      * Removes a module from the customModules array
      * @param {Object} module the module to remove from the customModules array