-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd-user.js
More file actions
64 lines (57 loc) · 1.86 KB
/
add-user.js
File metadata and controls
64 lines (57 loc) · 1.86 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
class addUser{
constructor(options){
}
addEditFieldToMainInfo (arr){
const fields = arr.map(value =>
`<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>${value}</span>
</button>
</div>`
).join("")
return `<div class="main-info-holder"> ${fields}</div> `
}
addEditFieldToScrollHolder (arr) {
const scrollHolder = arr.map(value =>
`<div class="edit-field">
<button href="#" class="add-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>${value}</span>
</button>
</div>`
).join("")
return `<div class="scroll-holder">
<div class="edit-info">
${scrollHolder}
<div class="edit-field">
<button href="#" class="delete-contact">delete contact</button>
</div>
</div>
</div>`
}
addUserPageOutput (){
let main = document.getElementById('app')
main.innerHTML += `<header class="header">
<div class="container top-radius">
<nav class="user-top-line">
<a href="user.html">Cansel</a>
<button class = "done-btn">Done</button>
</nav>
</div>
</header>
<main class="main">
<div class="container">
<div class="edit-main-info">
<div class="edit-foto">
<button class="add-foto-btn"><span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
<span>add foto</span></button>
</div>
${this.addEditFieldToMainInfo(["First Name",'Last Name','Company'])}
</div>
${this.addEditFieldToScrollHolder(['add mobile phone','add home phone',
'add email','add address','add birthday','add social profile', 'add field'])}
</div>
</main>`
}
}
let myAddUser = new addUser()
myAddUser.addUserPageOutput()