Select Git revision
view.js 1.44 KiB
addLoadEvent(onLoadViewRequest);
function onLoadViewRequest()
{
var tabBar = getElementsByClassName('tabBar');
tabBar = tabBar[0];
var tabs = tabBar.getElementsByTagName('a');
for (var i = 0; i < tabs.length; i++) {
tabs[i].onclick = viewRequestSelectTab;
}
}
function viewRequestSelectTab()
{
var commentsContent = document.getElementById('commentsContent');
var editorCommentsContent = document.getElementById('editorCommentsContent');
var privateCommentsContent = document.getElementById('privateCommentsContent');
var commentsTab = document.getElementById('commentsTab');
var editorCommentsTab = document.getElementById('editorCommentsTab');
var privateCommentsTab = document.getElementById('privateCommentsTab');
commentsContent.style.display = 'none';
editorCommentsContent.style.display = 'none';
privateCommentsContent.style.display = 'none';
commentsTab.className = '';
editorCommentsTab.className = '';
privateCommentsTab.className = '';
this.className = 'selected';
var ajax = new AjaxClient();
ajax.sendRequest('/Request/SetCommentTab/' + this.id);
if (this.id == 'commentsTab') {
commentsContent.style.display = 'block';
} else if (this.id == 'editorCommentsTab') {
editorCommentsContent.style.display = 'block';
} else if (this.id == 'privateCommentsTab') {
privateCommentsContent.style.display = 'block';
}
return false;
}