Trigger change and unbind after selecting in file browser

This commit is contained in:
JonnyWong16 2020-07-16 19:05:18 -07:00
commit ec34ea2116
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
3 changed files with 6 additions and 5 deletions

View file

@ -40,7 +40,7 @@
<div class="col-xs-12">
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-form" type="button" id="import_database_path_browse">Browse</button>
<button class="btn btn-form" type="button" id="import_database_path_browse" data-target="#import_database_path">Browse</button>
</span>
<input type="text" class="form-control" id="import_database_path" name="import_database_path" value="" placeholder="tautulli.db" required disabled>
</div>
@ -115,7 +115,7 @@
</div>
<script>
$("#import_database_path_browse").click(function () {
openBrowsePath(null, null, '.db', 'Database File', 'import_database_path');
openBrowsePath(null, null, '.db', 'Database File', $(this).data('target'));
});
$("#import_database_file").change(function() {

View file

@ -27,7 +27,7 @@
<div class="col-xs-12">
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-form" type="button" id="import_config_path_browse">Browse</button>
<button class="btn btn-form" type="button" id="import_config_path_browse" data-target="#import_config_path">Browse</button>
</span>
<input type="text" class="form-control" id="import_config_path" name="import_config_path" value="" placeholder="config.ini" required disabled>
</div>
@ -63,7 +63,7 @@
</div>
<script>
$("#import_config_path_browse").click(function () {
openBrowsePath(null, null, '.ini', 'Configuration File', 'import_config_path');
openBrowsePath(null, null, '.ini', 'Configuration File', $(this).data('target'));
});
$("#import_config_file").change(function() {

View file

@ -2033,7 +2033,8 @@ Rating: {rating}/10 --> Rating: /10
$("#select-browse-file").click(function () {
$("#browse-path-modal").modal('hide');
$("#" + select_target).val($("#browse-path").val());
$(select_target).val($("#browse-path").val()).change();
$(this).unbind('click');
});
browsePath(key, path, filter_ext);