-
Notifications
You must be signed in to change notification settings - Fork 0
/
own.js
50 lines (31 loc) · 1.15 KB
/
own.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
$(document).ready(function() {
var readURL = function(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('.avatar').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$(".file-upload").on('change', function(e){
readURL(this);
});
$("#submit").css("display","none");
$("#img").css("display","none");
//hide display and disable inputs & buttons
$("#edit").on('click' , function(){
$("#edit").text("Close");
$('input[type = "text"] , #password , #img').removeAttr("disabled");
$("#submit").css("display","inline");
$("#img").css("display","inline");
if( $("#edit").text() == "Close" ){
$("#edit").on('click' , function(){
$("#edit").text("Edit");
$('input[type = "text"], #email , #password , #img').attr("disabled","disabled");
$("#submit").css("display","none");
$("#img").css("display","none");
});
}
});
});