mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-22 03:52:21 -04:00
Fix on autofocus of prefix field.
We don't want it to be focused on page load, but each time the archive is selected (either through DeviceStorage or manual file selection)
This commit is contained in:
parent
21a97278b2
commit
86c2fe532d
@ -44,7 +44,7 @@
|
||||
<br />
|
||||
<form id="formTitleSearch" class="form-search">
|
||||
<div class="input-append">
|
||||
<input type="text" id="prefix" value="" placeholder="Find titles starting with..." class="input-medium search-query" autofocus/>
|
||||
<input type="text" id="prefix" value="" placeholder="Find titles starting with..." class="input-medium search-query" />
|
||||
<a class="btn" id="searchTitles" href="#"><i class="icon-search"></i></a>
|
||||
</div>
|
||||
<img id="searchingForTitles" src="img/spinner.gif" style="display: none;"/>
|
||||
|
10
js/app.js
10
js/app.js
@ -55,9 +55,9 @@ define(function(require) {
|
||||
else {
|
||||
// If DeviceStorage is not available, we display the file select components
|
||||
displayFileSelect();
|
||||
setLocalArchiveFromFileSelect();
|
||||
if (localArchive.dataFiles.length>0) {
|
||||
// Hide the configuration elements if already set
|
||||
if (document.getElementById('archiveFiles').files && document.getElementById('archiveFiles').files.length>0) {
|
||||
// Archive files are already selected,
|
||||
setLocalArchiveFromFileSelect();
|
||||
$('#configuration').hide();
|
||||
}
|
||||
}
|
||||
@ -104,6 +104,8 @@ define(function(require) {
|
||||
localArchive.readMathFilesFromStorage(storage, archiveDirectory);
|
||||
localArchive.readMetadataFileFromStorage(storage, archiveDirectory);
|
||||
localArchive.readCoordinateFilesFromStorage(storage, archiveDirectory, 0);
|
||||
// The archive is set : focus on the prefix field to start searching
|
||||
document.getElementById("prefix").focus();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,6 +122,8 @@ define(function(require) {
|
||||
function setLocalArchiveFromFileSelect() {
|
||||
localArchive = new evopedia.LocalArchive();
|
||||
localArchive.initializeFromArchiveFiles(document.getElementById('archiveFiles').files);
|
||||
// The archive is set : focus on the prefix field to start searching
|
||||
document.getElementById("prefix").focus();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user