Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsrec authored Mar 13, 2024
1 parent 84c3fcf commit e215fea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ $(function () {

elem.onblur = function() {
var currentname = elem.value || "";
var usernameblock = new OO.ui.infuse(elem.parentElement.parentElement.parentElement.parentElement);
// Start with username input field, and go up 4 levels, to the entire username container that OOUI will infuse onto
var usernameblock = new OO.ui.infuse(elem.closest('.oo-ui-layout'));
// Start with username input field, and go to the entire username container that OOUI will infuse onto
var noticebox = [];
if(currentname.length > 0 && currentname[0].match("[a-z]")){// Compare first letter to a regex, to check if it starts with a lowercase letter
noticebox[0] = new mw.message("createacct-normalization", "", currentname[0].toUpperCase() + currentname.slice(1)).text();
Expand Down

0 comments on commit e215fea

Please sign in to comment.