Skip to content

Commit 51dc76e

Browse files
authored
Merge pull request #27 from LogiGear/viet.bui/fixShadowProperty
fix update property visiable
2 parents ad8ae16 + da64c40 commit 51dc76e

2 files changed

Lines changed: 24 additions & 22 deletions

File tree

HTML_5/ControlsList/Properties.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function getElement_Top(idElement) {
3939

4040
function getElement_Width(idElement) {
4141
if (typeof (idElement) == "string") {
42-
element = document.getElementById(idElement);
42+
element = GetControlByIDAndShadowContext(idElement);
4343
}
4444
else {
4545
element = idElement;
@@ -61,7 +61,7 @@ function getElement_Width(idElement) {
6161

6262
function getElement_Height(idElement) {
6363
if (typeof (idElement) == "string") {
64-
element = document.getElementById(idElement);
64+
element = GetControlByIDAndShadowContext(idElement);
6565
}
6666
else {
6767
element = idElement;
@@ -156,40 +156,41 @@ function Element_visibility(value, isSet) {
156156

157157
if (isSet == 1) {
158158
if (value.toLowerCase() == "true")
159-
$("#" + IDControl).show();
159+
GetControlByIDAndShadowContext(IDControl).style.display = "";
160160
else
161-
$("#" + IDControl).hide();
161+
GetControlByIDAndShadowContext(IDControl).style.display = "none";
162162
}
163-
return ($("#" + IDControl).is(':visible'));
163+
164+
return GetControlByIDAndShadowContext(IDControl).style.display != "none";
164165
}
165166

166167
function Element_Width(value, isSet) {
167168
if (isSet == 1) {
168-
$("#" + IDControl).width(value);
169+
GetControlByIDAndShadowContext(IDControl).style.width = `${value}px`;
169170
// var valWidth = GetControlByIDAndShadowContext(IDControl).style.Width;
170171
}
171-
return getElement_Width(IDControl);
172+
return GetControlByIDAndShadowContext(IDControl).style.width;
172173
}
173174

174175
function Element_Height(value, isSet) {
175176
if (isSet == 1) {
176-
$("#" + IDControl).height(value);
177+
GetControlByIDAndShadowContext(IDControl).style.height = `${value}px`;
177178
}
178-
return getElement_Height(IDControl);
179+
return GetControlByIDAndShadowContext(IDControl).style.height;
179180
}
180181

181182
function Element_Left(value, isSet) {
182183
if (isSet == 1) {
183-
$("#" + IDControl).offset({ left: value });
184+
GetControlByIDAndShadowContext(IDControl).style.left = `${value}px`;
184185
}
185-
return getElement_Left(IDControl);
186+
return GetControlByIDAndShadowContext(IDControl).style.left;
186187
}
187188

188189
function Element_Top(value, isSet) {
189190
if (isSet == 1) {
190-
$("#" + IDControl).offset({ top: value });
191+
GetControlByIDAndShadowContext(IDControl).style.top = `${value}px`;
191192
}
192-
return getElement_Top(IDControl);
193+
return GetControlByIDAndShadowContext(IDControl).style.top;
193194
}
194195

195196
function Element_Check(value, isSet) {

HTML_5/HTML_JP/ControlsList/Properties.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function getElement_Top(idElement) {
3939

4040
function getElement_Width(idElement) {
4141
if (typeof (idElement) == "string") {
42-
element = document.getElementById(idElement);
42+
element = GetControlByIDAndShadowContext(idElement);
4343
}
4444
else {
4545
element = idElement;
@@ -61,7 +61,7 @@ function getElement_Width(idElement) {
6161

6262
function getElement_Height(idElement) {
6363
if (typeof (idElement) == "string") {
64-
element = document.getElementById(idElement);
64+
element = GetControlByIDAndShadowContext(idElement);
6565
}
6666
else {
6767
element = idElement;
@@ -156,38 +156,39 @@ function Element_visibility(value, isSet) {
156156

157157
if (isSet == 1) {
158158
if (value.toLowerCase() == "true")
159-
$("#" + IDControl).show();
159+
GetControlByIDAndShadowContext(IDControl).style.display = "";
160160
else
161-
$("#" + IDControl).hide();
161+
GetControlByIDAndShadowContext(IDControl).style.display = "none";
162162
}
163-
return ($("#" + IDControl).is(':visible'));
163+
164+
return GetControlByIDAndShadowContext(IDControl).style.display != "none";
164165
}
165166

166167
function Element_Width(value, isSet) {
167168
if (isSet == 1) {
168-
$("#" + IDControl).width(value);
169+
GetControlByIDAndShadowContext(IDControl).style.width = `${value}px`;
169170
// var valWidth = GetControlByIDAndShadowContext(IDControl).style.Width;
170171
}
171172
return getElement_Width(IDControl);
172173
}
173174

174175
function Element_Height(value, isSet) {
175176
if (isSet == 1) {
176-
$("#" + IDControl).height(value);
177+
GetControlByIDAndShadowContext(IDControl).style.height = `${value}px`;
177178
}
178179
return getElement_Height(IDControl);
179180
}
180181

181182
function Element_Left(value, isSet) {
182183
if (isSet == 1) {
183-
$("#" + IDControl).offset({ left: value });
184+
GetControlByIDAndShadowContext(IDControl).style.left = `${value}px`;
184185
}
185186
return getElement_Left(IDControl);
186187
}
187188

188189
function Element_Top(value, isSet) {
189190
if (isSet == 1) {
190-
$("#" + IDControl).offset({ top: value });
191+
GetControlByIDAndShadowContext(IDControl).style.top = `${value}px`;
191192
}
192193
return getElement_Top(IDControl);
193194
}

0 commit comments

Comments
 (0)