File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,19 @@ export function initRepoNew() {
1515 updateUiAutoInit ( ) ;
1616
1717 const inputRepoName = form . querySelector < HTMLInputElement > ( 'input[name="repo_name"]' ) ;
18+ const inputPrivate = form . querySelector < HTMLInputElement > ( 'input[name="private"]' ) ;
1819 const updateUiRepoName = ( ) => {
1920 const helps = form . querySelectorAll ( `.help[data-help-for-repo-name]` ) ;
2021 hideElem ( helps ) ;
2122 let help = form . querySelector ( `.help[data-help-for-repo-name="${ CSS . escape ( inputRepoName . value ) } "]` ) ;
2223 if ( ! help ) help = form . querySelector ( `.help[data-help-for-repo-name=""]` ) ;
2324 showElem ( help ) ;
25+ const repoNamePreferPrivate = { '.profile' : false , '.profile-private' : true } ;
26+ const preferPrivate = repoNamePreferPrivate [ inputRepoName . value ] ;
27+ // inputPrivate might be disabled because site admin "force private"
28+ if ( preferPrivate !== undefined && ! inputPrivate . closest ( '.disabled, [disabled]' ) ) {
29+ inputPrivate . checked = preferPrivate ;
30+ }
2431 } ;
2532 inputRepoName . addEventListener ( 'input' , updateUiRepoName ) ;
2633 updateUiRepoName ( ) ;
You can’t perform that action at this time.
0 commit comments