Skip to content

Commit

Permalink
Add network links to add user view
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhuff386 committed Oct 21, 2015
1 parent e577033 commit cfa251c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion www/views/modalAddUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ define([
var email = this.$('.email input').val();
var emailReg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;

var networkLink;
var networkLinks = [];
var networkLinksTemp = this.$('.network-links input').val().split(',');
for (var i = 0; i < networkLinksTemp.length; i++) {
networkLink = $.trim(networkLinksTemp[i]);
if (networkLink) {
networkLinks.push(networkLink);
}
}

if (!name) {
this.setAlert('danger', 'Name can not be empty.', '.form-group.name');
return;
Expand All @@ -47,7 +57,8 @@ define([
userModel.save({
organization: org,
name: name,
email: email
email: email,
network_links: networkLinks
}, {
success: function() {
this.close(true);
Expand Down

0 comments on commit cfa251c

Please sign in to comment.