Skip to content

Commit eada476

Browse files
committed
renaming
1 parent 7518f38 commit eada476

File tree

1 file changed

+17
-17
lines changed
  • services/static-webserver/client/source/class/osparc/ui/form

1 file changed

+17
-17
lines changed

services/static-webserver/client/source/class/osparc/ui/form/IntlTelInput.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
6868
members: {
6969
__htmlId: null,
7070
__inputElement: null,
71-
__intlTelInput: null,
71+
__phoneInput: null,
7272

7373
_createChildControlImpl: function(id) {
7474
let control;
@@ -88,13 +88,13 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
8888

8989
// IStringForm interface implementation
9090
getValue: function() {
91-
return this.__intlTelInput ? this.__intlTelInput.getNumber() : null;
91+
return this.__phoneInput ? this.__phoneInput.getNumber() : null;
9292
},
9393

9494
setValue: function(value) {
95-
if (this.__intlTelInput && value) {
95+
if (this.__phoneInput && value) {
9696
// intlTelInput doesn't have a full setter for raw numbers
97-
this.__intlTelInput.setNumber(value);
97+
this.__phoneInput.setNumber(value);
9898
}
9999
this._applyValue(value);
100100
},
@@ -130,7 +130,7 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
130130
},
131131

132132
isValidNumber: function() {
133-
return this.__intlTelInput ? this.__intlTelInput.isValidNumber() : false;
133+
return this.__phoneInput ? this.__phoneInput.isValidNumber() : false;
134134
},
135135

136136
verifyPhoneNumber: function() {
@@ -144,7 +144,7 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
144144
alignY: "middle",
145145
});
146146
if (!isValid) {
147-
const validationError = this.__intlTelInput.getValidationError();
147+
const validationError = this.__phoneInput.getValidationError();
148148
const errorMap = {
149149
0: this.tr("Invalid number"),
150150
1: this.tr("Invalid country code"),
@@ -172,14 +172,14 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
172172
margin: 0,
173173
});
174174

175-
const intlTelInput = this.__intlTelInput;
175+
const phoneInput = this.__phoneInput;
176176
const feedbackIcon = this.getChildControl("feedback-icon");
177-
if (intlTelInput) {
178-
intlTelInput.a.style["width"] = feedbackIcon.isVisible() ? "185px" : "215px";
179-
intlTelInput.a.style["height"] = height + "px";
180-
intlTelInput.a.style["borderWidth"] = "0px";
181-
intlTelInput.a.style["backgroundColor"] = isCompact ? "transparent" : bgColor;
182-
intlTelInput.a.style["color"] = textColor;
177+
if (phoneInput) {
178+
phoneInput.a.style["width"] = feedbackIcon.isVisible() ? "185px" : "215px";
179+
phoneInput.a.style["height"] = height + "px";
180+
phoneInput.a.style["borderWidth"] = "0px";
181+
phoneInput.a.style["backgroundColor"] = isCompact ? "transparent" : bgColor;
182+
phoneInput.a.style["color"] = textColor;
183183
}
184184

185185
document.documentElement.style.setProperty('--country-list-dropdown-bg', bgColor);
@@ -190,7 +190,7 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
190190
__convertInputToPhoneInput: function() {
191191
const convertInputToPhoneInput = () => {
192192
const domElement = document.querySelector(`#${this.__htmlId}`);
193-
this.__convertInputToIntlTelInput(domElement);
193+
this.__inputElementToPhoneInput(domElement);
194194
const phoneNumber = this.getChildControl("phone-input-field");
195195
phoneNumber.getContentElement().setStyles({
196196
"overflow": "visible" // needed for countries dropdown menu
@@ -210,9 +210,9 @@ qx.Class.define("osparc.ui.form.IntlTelInput", {
210210
}
211211
},
212212

213-
__convertInputToIntlTelInput: function(input) {
214-
this.__inputElement = input; // keep reference to raw <input>
215-
this.__intlTelInput = intlTelInput(input, {
213+
__inputElementToPhoneInput: function(domElement) {
214+
this.__inputElement = domElement; // keep reference to raw <input>
215+
this.__phoneInput = intlTelInput(domElement, {
216216
initialCountry: "auto",
217217
geoIpLookup: callback => {
218218
fetch("https://ipapi.co/json")

0 commit comments

Comments
 (0)