Refactor browse path function

This commit is contained in:
JonnyWong16
2020-07-16 18:19:43 -07:00
parent f0d4fd5523
commit 3dc36c3b92
3 changed files with 22 additions and 22 deletions

View File

@@ -114,19 +114,13 @@
</div>
</div>
<script>
$('#import_database_path_browse').click(function () {
$('#browse-path-type').text('Database File');
$('#browse-path-modal').modal('show');
browsePath(null, null, '.db');
});
$('#select-browse-file').click(function () {
$('#browse-path-modal').modal('hide');
$("#import_database_path").val($('#browse-path').val());
$("#import_database_path_browse").click(function () {
openBrowsePath(null, null, '.db', 'Database File', 'import_database_path');
});
$('#import_database_file').change(function() {
$("#import_database_file").change(function() {
if ($(this)[0].files[0]) {
$('#import_database_file_name').val($(this)[0].files[0].name);
$("#import_database_file_name").val($(this)[0].files[0].name);
}
});
@@ -134,7 +128,7 @@
$(this).prop('disabled', true);
var app = $("#import_app").val();
var database_file = $('#import_database_file')[0].files[0];
var database_file = $("#import_database_file")[0].files[0];
var database_path = $("#import_database_path").val();
var method = $("#import_method").val();
var backup = $("#import_backup_db").is(':checked');