瀏覽代碼

Remove source mapping for dev environment.
Bug fix: Changing unit conversion units was not working on first conversio.

Lee Morgan 4 年之前
父節點
當前提交
c6622fca3c
共有 3 個文件被更改,包括 3 次插入5 次删除
  1. 0 2
      app.js
  2. 0 0
      views/dashboardPage/bundle.js.map
  3. 3 3
      views/dashboardPage/js/sidebars/editIngredient.js

+ 0 - 2
app.js

@@ -37,7 +37,6 @@ let esbuildOptions = {
     bundle: true,
     bundle: true,
     minify: false,
     minify: false,
     outfile: "./views/dashboardPage/bundle.js",
     outfile: "./views/dashboardPage/bundle.js",
-    sourcemap: true
 };
 };
 
 
 app.use(express.static(__dirname + "/views"));
 app.use(express.static(__dirname + "/views"));
@@ -63,7 +62,6 @@ if(process.env.NODE_ENV === "production"){
     mongooseOptions.user = "website";
     mongooseOptions.user = "website";
     mongooseOptions.pass = process.env.SUBLINE_DB_PASS;
     mongooseOptions.pass = process.env.SUBLINE_DB_PASS;
     esbuildOptions.minify = true;
     esbuildOptions.minify = true;
-    esbuildOptions.sourcemap = false;
 }
 }
 
 
 mongoose.connect(`mongodb://127.0.0.1:27017/inventory-management`, mongooseOptions);
 mongoose.connect(`mongodb://127.0.0.1:27017/inventory-management`, mongooseOptions);

File diff suppressed because it is too large
+ 0 - 0
views/dashboardPage/bundle.js.map


+ 3 - 3
views/dashboardPage/js/sidebars/editIngredient.js

@@ -44,21 +44,21 @@ let editIngredient = {
         massDiv.children[1].innerText = (unit === "bottle") ? ingredient.ingredient.altUnit.toUpperCase() : unit.toUpperCase();
         massDiv.children[1].innerText = (unit === "bottle") ? ingredient.ingredient.altUnit.toUpperCase() : unit.toUpperCase();
         massDiv.children[3].value = parseFloat((ingredient.ingredient.convert.toMass / multiplier).toFixed(3));
         massDiv.children[3].value = parseFloat((ingredient.ingredient.convert.toMass / multiplier).toFixed(3));
         massDiv.children[4].value = "g";
         massDiv.children[4].value = "g";
-        massDiv.children[4].previousValue = "g";
+        massDiv.children[4].previousUnit = "g";
         massDiv.children[4].onchange = ()=>{this.changeConversionSelect(massDiv)};
         massDiv.children[4].onchange = ()=>{this.changeConversionSelect(massDiv)};
 
 
         volumeDiv.children[0].value = 1;
         volumeDiv.children[0].value = 1;
         volumeDiv.children[1].innerText = (unit === "bottle") ? ingredient.ingredient.altUnit.toUpperCase() : unit.toUpperCase();
         volumeDiv.children[1].innerText = (unit === "bottle") ? ingredient.ingredient.altUnit.toUpperCase() : unit.toUpperCase();
         volumeDiv.children[3].value = parseFloat((ingredient.ingredient.convert.toVolume / multiplier).toFixed(3));
         volumeDiv.children[3].value = parseFloat((ingredient.ingredient.convert.toVolume / multiplier).toFixed(3));
         volumeDiv.children[4].value = "l";
         volumeDiv.children[4].value = "l";
-        volumeDiv.children[4].previousValue = "l";
+        volumeDiv.children[4].previousUnit = "l";
         volumeDiv.children[4].onchange = ()=>{this.changeConversionSelect(volumeDiv)};
         volumeDiv.children[4].onchange = ()=>{this.changeConversionSelect(volumeDiv)};
 
 
         lengthDiv.children[0].value = 1;
         lengthDiv.children[0].value = 1;
         lengthDiv.children[1].innerText = (unit === "bottle") ? ingredient.ingredient.altUnit.toUpperCase() : unit.toUpperCase();
         lengthDiv.children[1].innerText = (unit === "bottle") ? ingredient.ingredient.altUnit.toUpperCase() : unit.toUpperCase();
         lengthDiv.children[3].value = parseFloat((ingredient.ingredient.convert.toLength / multiplier).toFixed(3));
         lengthDiv.children[3].value = parseFloat((ingredient.ingredient.convert.toLength / multiplier).toFixed(3));
         lengthDiv.children[4].value = "m";
         lengthDiv.children[4].value = "m";
-        lengthDiv.children[4].previousValue = "m";
+        lengthDiv.children[4].previousUnit = "m";
         lengthDiv.children[4].onchange = ()=>{this.changeConversionSelect(lengthDiv)};
         lengthDiv.children[4].onchange = ()=>{this.changeConversionSelect(lengthDiv)};
 
 
         switch(controller.getBaseUnit(unit)){
         switch(controller.getBaseUnit(unit)){

Some files were not shown because too many files changed in this diff