mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-22 12:01:15 -04:00
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:
parent
596b6e7b69
commit
a7e5cd3f6f
28
js/app.js
28
js/app.js
@ -35,46 +35,56 @@ define(function(require) {
|
||||
});
|
||||
// Navigation bar :
|
||||
$('#btnHome').on('click', function(e) {
|
||||
// Highlight the selected section in the navbar
|
||||
$('#liHomeNav').attr("class","active");
|
||||
$('#liConfigureNav').attr("class","");
|
||||
$('#liAboutNav').attr("class","");
|
||||
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
|
||||
$('#navbarToggle').click();
|
||||
}
|
||||
// Show the selected content in the page
|
||||
$('#about').hide();
|
||||
$('#configuration').hide();
|
||||
$('#formTitleSearch').show();
|
||||
$('#titleList').show();
|
||||
$('#articleContent').show();
|
||||
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
|
||||
$('#navbarToggle').click();
|
||||
}
|
||||
// Give the focus to the search field, and clean up the page contents
|
||||
$("#prefix").val("");
|
||||
$('#prefix').focus();
|
||||
$("#titleList").html("");
|
||||
$("#articleContent").html("");
|
||||
return false;
|
||||
});
|
||||
$('#btnConfigure').on('click', function(e) {
|
||||
// Highlight the selected section in the navbar
|
||||
$('#liHomeNav').attr("class","");
|
||||
$('#liConfigureNav').attr("class","active");
|
||||
$('#liAboutNav').attr("class","");
|
||||
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
|
||||
$('#navbarToggle').click();
|
||||
}
|
||||
// Show the selected content in the page
|
||||
$('#about').hide();
|
||||
$('#configuration').show();
|
||||
$('#formTitleSearch').hide();
|
||||
$('#titleList').hide();
|
||||
$('#articleContent').hide();
|
||||
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
|
||||
$('#navbarToggle').click();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
$('#btnAbout').on('click', function(e) {
|
||||
// Highlight the selected section in the navbar
|
||||
$('#liHomeNav').attr("class","");
|
||||
$('#liConfigureNav').attr("class","");
|
||||
$('#liAboutNav').attr("class","active");
|
||||
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
|
||||
$('#navbarToggle').click();
|
||||
}
|
||||
// Show the selected content in the page
|
||||
$('#about').show();
|
||||
$('#configuration').hide();
|
||||
$('#formTitleSearch').hide();
|
||||
$('#titleList').hide();
|
||||
$('#articleContent').hide();
|
||||
if ($('#navbarToggle').is(":visible") && $('#liHomeNav').is(':visible')) {
|
||||
$('#navbarToggle').click();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user