summaryrefslogtreecommitdiffstats
path: root/public/js/gogs.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r--public/js/gogs.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js
index 25a1dc1336..c9f621745b 100644
--- a/public/js/gogs.js
+++ b/public/js/gogs.js
@@ -737,6 +737,16 @@ function setCodeMirror($editArea) {
}
function initEditor() {
+ $('.js-quick-pull-choice-option').change(function () {
+ if ($(this).val() == 'commit-to-new-branch') {
+ $('.quick-pull-branch-name').show();
+ $('.quick-pull-branch-name input').prop('required',true);
+ } else {
+ $('.quick-pull-branch-name').hide();
+ $('.quick-pull-branch-name input').prop('required',false);
+ }
+ });
+
var $editFilename = $("#file-name");
$editFilename.keyup(function (e) {
var $section = $('.breadcrumb span.section');
@@ -841,16 +851,6 @@ function initEditor() {
codeMirrorEditor.setOption("lineWrapping", false);
}
}).trigger('keyup');
-
-
- $('.js-quick-pull-choice-option').change(function () {
- if ($(this).val() == 'commit-to-new-branch') {
- $('.quick-pull-branch-name').show();
- } else {
- $('.quick-pull-branch-name').hide();
- }
- });
-
}
function initOrganization() {