summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-branch.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features/repo-branch.js')
-rw-r--r--web_src/js/features/repo-branch.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/web_src/js/features/repo-branch.js b/web_src/js/features/repo-branch.js
index e7c2645dcd..e6da9661b6 100644
--- a/web_src/js/features/repo-branch.js
+++ b/web_src/js/features/repo-branch.js
@@ -1,4 +1,5 @@
import $ from 'jquery';
+import {toggleElem} from '../utils/dom.js';
export function initRepoBranchButton() {
initRepoCreateBranchButton();
@@ -31,6 +32,10 @@ function initRepoRenameBranchButton() {
const oldBranchName = $(this).attr('data-old-branch-name');
$modal.find('input[name=from]').val(oldBranchName);
+ // display the warning that the branch which is chosen is the default branch
+ const $warn = $modal.find('.default-branch-warning');
+ toggleElem($warn, $(this).attr('data-is-default-branch') === 'true');
+
const $text = $modal.find('[data-rename-branch-to]');
$text.text($text.attr('data-rename-branch-to').replace('%s', oldBranchName));
});