Skip to content

Commit 7b2000d

Browse files
committed
Save 'main' in the placeholder
Instead, save 'main' in the placeholder attribute of ref, then default to that value if a ref is not provided. This reduces the number of places the default ref needs to be updated.
1 parent 0e6da02 commit 7b2000d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

binderhub/static/js/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function updateRepoText() {
101101
}
102102
$("#repository").attr('placeholder', text);
103103
$("label[for=repository]").text(text);
104-
$("#ref").attr('placeholder', tag_text);
104+
$("#ref").attr('placeholder', 'main');
105105
$("label[for=ref]").text(tag_text);
106106
}
107107

@@ -121,7 +121,7 @@ function getBuildFormValues() {
121121
repo = encodeURIComponent(repo);
122122
}
123123

124-
var ref = $('#ref').val().trim() || 'main';
124+
var ref = $('#ref').val().trim() || $("#ref").attr("placeholder");
125125
if (providerPrefix === 'zenodo' || providerPrefix === 'figshare' || providerPrefix === 'dataverse' ||
126126
providerPrefix === 'hydroshare') {
127127
ref = "";

0 commit comments

Comments
 (0)