GRN2-266: Autofocus room name when create room modal appears (#945)

* added autofocus to the Room Name field

* added autofocus to Room Name text field

* added autofocus to Room Name text field

* GRN2-266 Fixing autofocus for Room name when creating room

* removing whitespace

* fixing whitespace

* fixing whitespace
This commit is contained in:
etiennevvv 2020-02-04 12:18:10 -05:00 committed by farhatahmad
parent eb8cc9b17f
commit 68b231dbdb
1 changed files with 7 additions and 0 deletions

View File

@ -51,6 +51,13 @@ $(document).on('turbolinks:load', function(){
}) })
} }
// Autofocus on the Room Name label when creating a room only
$('#createRoomModal').on('shown.bs.modal', function (){
if ($(".create-only").css("display") == "block"){
$('#create-room-name').focus()
}
})
if (controller == "rooms" && action == "show" || controller == "admins" && action == "server_rooms"){ if (controller == "rooms" && action == "show" || controller == "admins" && action == "server_rooms"){
// Display and update all fields related to creating a room in the createRoomModal // Display and update all fields related to creating a room in the createRoomModal
$(".update-room").click(function(){ $(".update-room").click(function(){