From 0114fdcba40270731d59fe24e8fa6c6147d69e01 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 28 Aug 2016 01:41:44 -0700 Subject: Web editor: improve delete file process --- public/js/gogs.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'public/js') diff --git a/public/js/gogs.js b/public/js/gogs.js index 25a1dc13..c9f62174 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() { -- cgit v1.2.3