Skip to content

Commit 2b40a17

Browse files
author
Kritin Vij
committed
Made function wrappers
1 parent c6f014d commit 2b40a17

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

app/views/event_attendances/index.html.erb

+7-13
Original file line numberDiff line numberDiff line change
@@ -91,25 +91,19 @@ function updateEmailLinks() {
9191

9292
// create an email list of those people attending
9393
var emailsAttending = [];
94-
function getAttending() {
95-
attending_rows.each(function(key, value) {
96-
emailsAttending.push(value.getAttribute('data-email'));
97-
});
98-
}
99-
getAttending();
94+
attending_rows.each(function(key, value) {
95+
emailsAttending.push(value.getAttribute('data-email'));
96+
});
10097

10198
// make the array into string and then set that as a value to the email link
102-
emailsAttending = emailsAttending.splice(',').join(',');
99+
emailsAttending = emailsAttending.join(',');
103100
$('#attending_email_link').attr("href", "mailto:" + emailsAttending);
104101

105102
// similarly for the Attended emails
106103
var emailsAttended = [];
107-
function getAttended() {
108-
attended_rows.each(function(key, value) {
109-
emailsAttended.push(value.getAttribute('data-email'));
110-
});
111-
}
112-
getAttended();
104+
attended_rows.each(function(key, value) {
105+
mailsAttended.push(value.getAttribute('data-email'));
106+
});
113107
emailsAttended = emailsAttended.join(',');
114108
$('#attended_email_link').attr("href", "mailto:" + emailsAttended);
115109
}

0 commit comments

Comments
 (0)