|
|
@ -10,6 +10,7 @@ import Page from './page'; |
|
|
|
import { mediaSizes } from '../lib/config'; |
|
|
|
import { mediaSizes } from '../lib/config'; |
|
|
|
import passwordManager from '../lib/mtproto/passwordManager'; |
|
|
|
import passwordManager from '../lib/mtproto/passwordManager'; |
|
|
|
import { AccountPassword } from '../types'; |
|
|
|
import { AccountPassword } from '../types'; |
|
|
|
|
|
|
|
import { cancelEvent } from '../lib/utils'; |
|
|
|
|
|
|
|
|
|
|
|
let onFirstMount = (): Promise<any> => { |
|
|
|
let onFirstMount = (): Promise<any> => { |
|
|
|
let needFrame = 0; |
|
|
|
let needFrame = 0; |
|
|
@ -42,25 +43,28 @@ let onFirstMount = (): Promise<any> => { |
|
|
|
getState(); |
|
|
|
getState(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
toggleVisible.addEventListener('click', function(this, e) { |
|
|
|
const onVisibilityClick = function(this: typeof toggleVisible, e: Event) { |
|
|
|
|
|
|
|
cancelEvent(e); |
|
|
|
passwordVisible = !passwordVisible; |
|
|
|
passwordVisible = !passwordVisible; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.classList.toggle('tgico-eye2', passwordVisible); |
|
|
|
if(passwordVisible) { |
|
|
|
if(passwordVisible) { |
|
|
|
this.classList.add('tgico-eye2'); |
|
|
|
|
|
|
|
passwordInput.setAttribute('type', 'text'); |
|
|
|
passwordInput.setAttribute('type', 'text'); |
|
|
|
animation.setDirection(1); |
|
|
|
animation.setDirection(1); |
|
|
|
animation.curFrame = 0; |
|
|
|
animation.curFrame = 0; |
|
|
|
needFrame = 16; |
|
|
|
needFrame = 16; |
|
|
|
animation.play(); |
|
|
|
animation.play(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.classList.remove('tgico-eye2'); |
|
|
|
|
|
|
|
passwordInput.setAttribute('type', 'password'); |
|
|
|
passwordInput.setAttribute('type', 'password'); |
|
|
|
animation.setDirection(-1); |
|
|
|
animation.setDirection(-1); |
|
|
|
animation.curFrame = 16; |
|
|
|
animation.curFrame = 16; |
|
|
|
needFrame = 0; |
|
|
|
needFrame = 0; |
|
|
|
animation.play(); |
|
|
|
animation.play(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toggleVisible.addEventListener('click', onVisibilityClick); |
|
|
|
|
|
|
|
toggleVisible.addEventListener('touchend', onVisibilityClick); |
|
|
|
|
|
|
|
|
|
|
|
let state: AccountPassword; |
|
|
|
let state: AccountPassword; |
|
|
|
|
|
|
|
|
|
|
|