1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-29 18:39:49 +02:00

moved includes to src/includes, added modal input focus

This commit is contained in:
Marco Dickert
2017-02-17 14:05:45 +01:00
parent aee4962012
commit 709acbfc67
11 changed files with 34 additions and 10 deletions

14
ifm.php
View File

@@ -454,8 +454,14 @@ function IFM() {
modalDialog.append( modalContent );
modal.append( modalDialog );
$( document.body ).append( modal );
modal.modal();
modal.on('hide.bs.modal', function () { $(this).remove(); });
modal.on('shown.bs.modal', function () {
var formElements = $(this).find('input, button');
if( formElements.length > 0 ) {
formElements.first().focus();
}
});
modal.modal('show');
};
this.hideModal = function() {
@@ -1079,6 +1085,12 @@ function IFM() {
$("#upload").click(function(){
self.uploadFileDialog();
});
$('#currentDir').on( 'keypress', function (event) {
if( event.keyCode == 13 ) {
event.preventDefault();
self.changeDirectory( $(this).val(), { absolute: true } );
}
});
$(document).on( 'keypress', self.handleKeystrokes );
// handle history manipulation