From da64c40c3bbde6d3323237de371b61cbcb61f0c4 Mon Sep 17 00:00:00 2001 From: "viet.bui" Date: Wed, 27 May 2026 15:02:45 +0700 Subject: [PATCH] fix update property visiable --- HTML_5/ControlsList/Properties.js | 27 ++++++++++++----------- HTML_5/HTML_JP/ControlsList/Properties.js | 19 ++++++++-------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/HTML_5/ControlsList/Properties.js b/HTML_5/ControlsList/Properties.js index c3770c7..e7e06c5 100644 --- a/HTML_5/ControlsList/Properties.js +++ b/HTML_5/ControlsList/Properties.js @@ -39,7 +39,7 @@ function getElement_Top(idElement) { function getElement_Width(idElement) { if (typeof (idElement) == "string") { - element = document.getElementById(idElement); + element = GetControlByIDAndShadowContext(idElement); } else { element = idElement; @@ -61,7 +61,7 @@ function getElement_Width(idElement) { function getElement_Height(idElement) { if (typeof (idElement) == "string") { - element = document.getElementById(idElement); + element = GetControlByIDAndShadowContext(idElement); } else { element = idElement; @@ -156,40 +156,41 @@ function Element_visibility(value, isSet) { if (isSet == 1) { if (value.toLowerCase() == "true") - $("#" + IDControl).show(); + GetControlByIDAndShadowContext(IDControl).style.display = ""; else - $("#" + IDControl).hide(); + GetControlByIDAndShadowContext(IDControl).style.display = "none"; } - return ($("#" + IDControl).is(':visible')); + + return GetControlByIDAndShadowContext(IDControl).style.display != "none"; } function Element_Width(value, isSet) { if (isSet == 1) { - $("#" + IDControl).width(value); + GetControlByIDAndShadowContext(IDControl).style.width = `${value}px`; // var valWidth = GetControlByIDAndShadowContext(IDControl).style.Width; } - return getElement_Width(IDControl); + return GetControlByIDAndShadowContext(IDControl).style.width; } function Element_Height(value, isSet) { if (isSet == 1) { - $("#" + IDControl).height(value); + GetControlByIDAndShadowContext(IDControl).style.height = `${value}px`; } - return getElement_Height(IDControl); + return GetControlByIDAndShadowContext(IDControl).style.height; } function Element_Left(value, isSet) { if (isSet == 1) { - $("#" + IDControl).offset({ left: value }); + GetControlByIDAndShadowContext(IDControl).style.left = `${value}px`; } - return getElement_Left(IDControl); + return GetControlByIDAndShadowContext(IDControl).style.left; } function Element_Top(value, isSet) { if (isSet == 1) { - $("#" + IDControl).offset({ top: value }); + GetControlByIDAndShadowContext(IDControl).style.top = `${value}px`; } - return getElement_Top(IDControl); + return GetControlByIDAndShadowContext(IDControl).style.top; } function Element_Check(value, isSet) { diff --git a/HTML_5/HTML_JP/ControlsList/Properties.js b/HTML_5/HTML_JP/ControlsList/Properties.js index c3770c7..ec76299 100644 --- a/HTML_5/HTML_JP/ControlsList/Properties.js +++ b/HTML_5/HTML_JP/ControlsList/Properties.js @@ -39,7 +39,7 @@ function getElement_Top(idElement) { function getElement_Width(idElement) { if (typeof (idElement) == "string") { - element = document.getElementById(idElement); + element = GetControlByIDAndShadowContext(idElement); } else { element = idElement; @@ -61,7 +61,7 @@ function getElement_Width(idElement) { function getElement_Height(idElement) { if (typeof (idElement) == "string") { - element = document.getElementById(idElement); + element = GetControlByIDAndShadowContext(idElement); } else { element = idElement; @@ -156,16 +156,17 @@ function Element_visibility(value, isSet) { if (isSet == 1) { if (value.toLowerCase() == "true") - $("#" + IDControl).show(); + GetControlByIDAndShadowContext(IDControl).style.display = ""; else - $("#" + IDControl).hide(); + GetControlByIDAndShadowContext(IDControl).style.display = "none"; } - return ($("#" + IDControl).is(':visible')); + + return GetControlByIDAndShadowContext(IDControl).style.display != "none"; } function Element_Width(value, isSet) { if (isSet == 1) { - $("#" + IDControl).width(value); + GetControlByIDAndShadowContext(IDControl).style.width = `${value}px`; // var valWidth = GetControlByIDAndShadowContext(IDControl).style.Width; } return getElement_Width(IDControl); @@ -173,21 +174,21 @@ function Element_Width(value, isSet) { function Element_Height(value, isSet) { if (isSet == 1) { - $("#" + IDControl).height(value); + GetControlByIDAndShadowContext(IDControl).style.height = `${value}px`; } return getElement_Height(IDControl); } function Element_Left(value, isSet) { if (isSet == 1) { - $("#" + IDControl).offset({ left: value }); + GetControlByIDAndShadowContext(IDControl).style.left = `${value}px`; } return getElement_Left(IDControl); } function Element_Top(value, isSet) { if (isSet == 1) { - $("#" + IDControl).offset({ top: value }); + GetControlByIDAndShadowContext(IDControl).style.top = `${value}px`; } return getElement_Top(IDControl); }