-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathadd.js
More file actions
32 lines (23 loc) · 714 Bytes
/
add.js
File metadata and controls
32 lines (23 loc) · 714 Bytes
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
/**
* pages.add
*
* Provides functionality of the add contact page
*/
(function(global) {
var add = { el : $('#page-add') };
add.onSave = function() {
var name = add.el.find('#fld-name').val(),
phone = add.el.find('#fld-phone').val(),
email = add.el.find('#fld-email').val();
global.store.addContact(global.store.ContactInfo(name, phone, email));
global.pages.contacts.refresh();
};
add.el.live('pagecreate', function() {
add.el = $(this);
add.el.find('#btn-save-contact').click(add.onSave);
});
if ( typeof global.pages === 'undefined' ) {
global.pages = {};
}
global.pages.add = add;
}(this));