Skip to content
Snippets Groups Projects
Commit b0d644d5 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Disabled join button if no user is selected

parent 04d5d8ea
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
for (var i = 0; i < users.length; i++) { for (var i = 0; i < users.length; i++) {
$userSelector.append('<option value="' + i + '">' + users[i] + '</option>'); $userSelector.append('<option value="' + i + '">' + users[i] + '</option>');
} }
updateJoinButtonStatus();
}); });
}; };
} }
...@@ -71,6 +73,14 @@ ...@@ -71,6 +73,14 @@
$('.primary-identity-icon').tooltip(); $('.primary-identity-icon').tooltip();
} }
/**
* Enable or disable the join button if there are selected users or not.
*/
function updateJoinButtonStatus() {
var selectedUserIndex = $('#user-selector-group select').val();
$('#send-join-request-btn').prop("disabled", selectedUserIndex === null);
}
// When the document is loaded // When the document is loaded
$(document).ready(function () { $(document).ready(function () {
...@@ -93,6 +103,8 @@ ...@@ -93,6 +103,8 @@
$('#info-message-alert').addClass('hide'); $('#info-message-alert').addClass('hide');
}); });
$('#search-user-modal').on('shown.bs.modal', updateJoinButtonStatus);
loadTooltips(); loadTooltips();
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment