Skip to content

Commit 4137f33

Browse files
author
Kritin Vij
committed
Made function wrappers
1 parent c6f014d commit 4137f33

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/views/event_attendances/index.html.erb

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

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

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

105104
// similarly for the Attended emails
106105
var emailsAttended = [];
107-
function getAttended() {
106+
$(function(){
108107
attended_rows.each(function(key, value) {
109108
emailsAttended.push(value.getAttribute('data-email'));
110109
});
111-
}
112-
getAttended();
110+
});
113111
emailsAttended = emailsAttended.join(',');
114112
$('#attended_email_link').attr("href", "mailto:" + emailsAttended);
115113
}

0 commit comments

Comments
 (0)