A click on the Home section empties its content, so that the user he finds the same home page as when he started the application.

Fixes #38
This commit is contained in:
mossroy 2013-08-02 10:22:19 +02:00
parent 596b6e7b69
commit a7e5cd3f6f

View File

@ -35,46 +35,56 @@ define(function(require) {
}); });
// Navigation bar : // Navigation bar :
$('#btnHome').on('click', function(e) { $('#btnHome').on('click', function(e) {
// Highlight the selected section in the navbar
$('#liHomeNav').attr("class","active"); $('#liHomeNav').attr("class","active");
$('#liConfigureNav').attr("class",""); $('#liConfigureNav').attr("class","");
$('#liAboutNav').attr("class",""); $('#liAboutNav').attr("class","");
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
$('#navbarToggle').click();
}
// Show the selected content in the page
$('#about').hide(); $('#about').hide();
$('#configuration').hide(); $('#configuration').hide();
$('#formTitleSearch').show(); $('#formTitleSearch').show();
$('#titleList').show(); $('#titleList').show();
$('#articleContent').show(); $('#articleContent').show();
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) { // Give the focus to the search field, and clean up the page contents
$('#navbarToggle').click(); $("#prefix").val("");
}
$('#prefix').focus(); $('#prefix').focus();
$("#titleList").html("");
$("#articleContent").html("");
return false; return false;
}); });
$('#btnConfigure').on('click', function(e) { $('#btnConfigure').on('click', function(e) {
// Highlight the selected section in the navbar
$('#liHomeNav').attr("class",""); $('#liHomeNav').attr("class","");
$('#liConfigureNav').attr("class","active"); $('#liConfigureNav').attr("class","active");
$('#liAboutNav').attr("class",""); $('#liAboutNav').attr("class","");
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
$('#navbarToggle').click();
}
// Show the selected content in the page
$('#about').hide(); $('#about').hide();
$('#configuration').show(); $('#configuration').show();
$('#formTitleSearch').hide(); $('#formTitleSearch').hide();
$('#titleList').hide(); $('#titleList').hide();
$('#articleContent').hide(); $('#articleContent').hide();
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
$('#navbarToggle').click();
}
return false; return false;
}); });
$('#btnAbout').on('click', function(e) { $('#btnAbout').on('click', function(e) {
// Highlight the selected section in the navbar
$('#liHomeNav').attr("class",""); $('#liHomeNav').attr("class","");
$('#liConfigureNav').attr("class",""); $('#liConfigureNav').attr("class","");
$('#liAboutNav').attr("class","active"); $('#liAboutNav').attr("class","active");
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
$('#navbarToggle').click();
}
// Show the selected content in the page
$('#about').show(); $('#about').show();
$('#configuration').hide(); $('#configuration').hide();
$('#formTitleSearch').hide(); $('#formTitleSearch').hide();
$('#titleList').hide(); $('#titleList').hide();
$('#articleContent').hide(); $('#articleContent').hide();
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
$('#navbarToggle').click();
}
return false; return false;
}); });