View difference between Paste ID: 20vkeXqa and iaHTkexm
SHOW: | | - or go back to the newest paste.
1
// function to hide and show comments
2-
	// ...
2+
3
	// all works
4
	(show) ? $('#' + id).fadeIn() : $('#' + id).fadeOut();
5
	document.getElementById(expcolid).onclick = (show)?function () { showComment(id, expcolid,false); }:function () { showComment(id, expcolid,true); }
6-
	(show) ? function () { showComment('sub' + id, 'expcolid' + id, true); } : function () { showComment('sub' + id, 'expcolid' + id, false); };
6+
	document.getElementById(expcolid).title = (show)?"Hide Comments":"Show Comments";
7
}
8
9-
// anything wrong with the code in the second function??
9+
// function to hide and show add comment sections
10
function showAddCommentForm(id, show) {
11
	
12
	// this works
13
	(show) ? $('#addCommentField' + id).fadeIn() : $('#addCommentField' + id).fadeOut();
14
	
15
	// doesnt work
16
	(show) ? function () { showComment('sub' + id, 'expcolid' + id, true); }:function () { showComment('sub' + id, 'expcolid' + id, false); };
17
	
18
	// these all work
19
	document.getElementById('addCommentLink' + id).onclick = (show)?function () { showAddCommentForm(id, false); }:function () { showAddCommentForm(id, true); }
20
	document.getElementById('addCommentLink' + id).title = (show)?"Cancel":"Add Comment";
21
	document.getElementById('addCommentLink' + id).innerHTML = (show)?"Cancel Add Comment":"Add Comment";
22
}