-
Notifications
You must be signed in to change notification settings - Fork 1
/
dom.js
24 lines (21 loc) · 858 Bytes
/
dom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var render = function( resultsObj ) {
var lineTitleSelector = document.getElementsByClassName('selected-line')[0];
var imageSelector = document.getElementsByClassName('giphy')[0];
var captionSelector = document.getElementsByClassName('status-severity')[0];
lineTitleSelector.textContent = resultsObj.line;
imageSelector.src = resultsObj.url;
imageSelector.setAttribute('alt', resultsObj.status);
imageSelector.setAttribute('title', resultsObj.status);
captionSelector.textContent = resultsObj.status;
};
( function() {
var tubeLines = document.getElementsByName('tube-lines'),
form = document.getElementsByClassName('choose-your-line')[0];
form.addEventListener( 'click', function( e ) {
tubeLines.forEach( function( line ) {
if ( line.checked ) {
logicObj.init( line.value );
};
});
});
}() );