Commit b0d644d5 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Disabled join button if no user is selected

parent 04d5d8ea
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
                for (var i = 0; i < users.length; i++) {
                    $userSelector.append('<option value="' + i + '">' + users[i] + '</option>');
                }
                
                updateJoinButtonStatus();
            });
        };
    }
@@ -71,6 +73,14 @@
        $('.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
    $(document).ready(function () {

@@ -93,6 +103,8 @@
            $('#info-message-alert').addClass('hide');
        });

        $('#search-user-modal').on('shown.bs.modal', updateJoinButtonStatus);

        loadTooltips();
    });