|
@@ -94,7 +94,12 @@ function Form (parent){
|
|
|
/* pswd.setValue('qwerty'); */
|
|
|
|
|
|
let actionbutton = (passwordValue) => {
|
|
|
- (passwordValue && this.getloginValue())? acceptButton.disabled = false : acceptButton.disabled=true
|
|
|
+ /* (passwordValue && this.getloginValue())? acceptButton.disabled = false : acceptButton.disabled=true */
|
|
|
+ if(passwordValue && this.getloginValue()){
|
|
|
+ acceptButton.disabled = false
|
|
|
+ }else {
|
|
|
+ acceptButton.disabled = true
|
|
|
+ }
|
|
|
}
|
|
|
this.setLoginValue = value =>{
|
|
|
loginValue = value;
|
|
@@ -113,10 +118,15 @@ function Form (parent){
|
|
|
this.setLoginValue(login.value);
|
|
|
}
|
|
|
|
|
|
- this.setValuePassword = (newpswd) => {
|
|
|
- pswd.setValue(newpswd)
|
|
|
+
|
|
|
+ pswd.onChange = (newpswd) => {
|
|
|
+ if(newpswd !== pswd.getValue() && typeof this.onChangePswd ==='function'){
|
|
|
+ this.onChangePswd(newpswd);
|
|
|
+ }
|
|
|
actionbutton(pswd.getValue());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
/* let pswdTrueOrNot = (passwordValue, checkPswdValue) =>{
|
|
|
if(checkPswdValue !== passwordValue){
|
|
|
checkPswd.style.border = 'red'
|
|
@@ -139,7 +149,10 @@ function Form (parent){
|
|
|
} */
|
|
|
// trash set and get
|
|
|
this.getValuePassword = () => pswd.getValue();
|
|
|
- actionbutton(this.getValuePassword());
|
|
|
+ this.setValuePassword = (newpswd) => {
|
|
|
+ pswd.setValue(newpswd);
|
|
|
+ }
|
|
|
+ actionbutton(pswd.getValue());
|
|
|
}
|
|
|
|
|
|
/* let p = new Password(document.body, true); */
|