Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- Restore missing include in ajax/dropdownAuthorization.php
- Fix mail collector login field not synced with the selected OAuth authorization on form load

## [1.4.5] - 2026-06-24

Expand Down
22 changes: 14 additions & 8 deletions inc/mailcollectorfeature.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ function () {
login_field.parent().append('<div id="auth_field_container" style="display:none;"></div>');
var auth_field_container = $('#auth_field_container');

// Sync login field value onto the value carried by the authorization select
// (dropdown option selected by the user, or the one pre-selected on load).
var sync_login_from_auth_select = function () {
var select = auth_field_container.find('select');
if (select.val() == -1) {
login_field.val('');
} else {
login_field.val(select.find('option:selected').text());
}
};

server_type_field.on(
'change',
function (evt) {
Expand All @@ -161,7 +172,8 @@ function (evt) {
{
application_id: application_id,
selected: login_field.val()
}
},
sync_login_from_auth_select
);
} else {
password_field.closest('tr').show();
Expand All @@ -177,13 +189,7 @@ function (evt) {
auth_field_container.on(
'change',
'select',
function (evt) {
if ($(this).val() == -1) {
login_field.val('');
} else {
login_field.val($(this).find('option:selected').text());
}
}
sync_login_from_auth_select
);

server_type_field.trigger('change');
Expand Down
Loading