From c75d0fd0ce36060ad47f45a5798527b4a498e1e7 Mon Sep 17 00:00:00 2001 From: N0rdye Date: Tue, 3 Oct 2023 22:06:01 +0500 Subject: [PATCH] calculator fix --- db.js | 2 +- views/admin/objects/object_creation.ejs | 4 +++- views/project.ejs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/db.js b/db.js index b733043..8464580 100644 --- a/db.js +++ b/db.js @@ -1,6 +1,6 @@ const mysql = require('mysql'); const vars = require('./vars'); -const db_host = "localhost"; +const db_host = "db"; const admin = mysql.createConnection({ host: db_host, diff --git a/views/admin/objects/object_creation.ejs b/views/admin/objects/object_creation.ejs index 57198d8..6fa8d11 100644 --- a/views/admin/objects/object_creation.ejs +++ b/views/admin/objects/object_creation.ejs @@ -236,7 +236,9 @@ } else if(res["out"] == "good"){ msg("товар добавлен"); - edit_get_objs(); + setTimeout(()=>{ + edit_get_objs(); + },500) } }); } diff --git a/views/project.ejs b/views/project.ejs index e2427f8..6f91742 100644 --- a/views/project.ejs +++ b/views/project.ejs @@ -341,7 +341,7 @@ spawn.src = ""; }) if(cost == true){ - width += 252; + width += document.getElementById("proj_cost").getBoundingClientRect().width; document.getElementById("drags").append(document.getElementById("cost_div")); document.getElementById("cost_div").style.marginLeft = `${parseInt(document.getElementById("wall").style.width) + 4}px`; document.getElementById("cost_list").style.display = "block";