Skip to content

Commit 025ce54

Browse files
authored
Merge pull request #1172 from sgibson91/update-default-branch
Update UI and launch main branch by default for GitHub repos
2 parents 8c5b0c9 + c1b7dc6 commit 025ce54

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

binderhub/static/js/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ function updateRepoText() {
6363
var text;
6464
var provider = $("#provider_prefix").val();
6565
var tag_text = "Git branch, tag, or commit";
66+
var placeholder = "master";
67+
if (provider === "gh") {
68+
placeholder = "main";
69+
}
6670
// first enable branch/ref field, some providers later disable it
6771
$("#ref").prop("disabled", false);
6872
$("label[for=ref]").prop("disabled", false);
@@ -101,7 +105,7 @@ function updateRepoText() {
101105
}
102106
$("#repository").attr('placeholder', text);
103107
$("label[for=repository]").text(text);
104-
$("#ref").attr('placeholder', tag_text);
108+
$("#ref").attr('placeholder', placeholder);
105109
$("label[for=ref]").text(tag_text);
106110
}
107111

@@ -121,7 +125,7 @@ function getBuildFormValues() {
121125
repo = encodeURIComponent(repo);
122126
}
123127

124-
var ref = $('#ref').val().trim() || 'master';
128+
var ref = $('#ref').val().trim() || $("#ref").attr("placeholder");
125129
if (providerPrefix === 'zenodo' || providerPrefix === 'figshare' || providerPrefix === 'dataverse' ||
126130
providerPrefix === 'hydroshare') {
127131
ref = "";

0 commit comments

Comments
 (0)