diff options
author | Unknwon <u@gogs.io> | 2015-10-29 21:09:48 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-10-29 21:09:48 -0400 |
commit | 7d72c8333e05b377d42fb773ef2d952c8ec87d32 (patch) | |
tree | 0390d83b543b791ad54a40343e2ae76758eebffc /public/js | |
parent | 706b0f72e2e4bc91bdbed38fee609cabe9f44e43 (diff) | |
download | gitea-7d72c8333e05b377d42fb773ef2d952c8ec87d32.tar.gz gitea-7d72c8333e05b377d42fb773ef2d952c8ec87d32.zip |
work on #470 and fix miror JS issue when choose targets on compare and pull
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/gogs.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index d835fa052f..f297191a90 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -384,16 +384,15 @@ function initRepository() { // Diff if ($('.repository.diff').length > 0) { var $counter = $('.diff-counter'); - if ($counter.length < 1) { - return; + if ($counter.length >= 1) { + $counter.each(function (i, item) { + var $item = $(item); + var addLine = $item.find('span[data-line].add').data("line"); + var delLine = $item.find('span[data-line].del').data("line"); + var addPercent = parseFloat(addLine) / (parseFloat(addLine) + parseFloat(delLine)) * 100; + $item.find(".bar .add").css("width", addPercent + "%"); + }); } - $counter.each(function (i, item) { - var $item = $(item); - var addLine = $item.find('span[data-line].add').data("line"); - var delLine = $item.find('span[data-line].del').data("line"); - var addPercent = parseFloat(addLine) / (parseFloat(addLine) + parseFloat(delLine)) * 100; - $item.find(".bar .add").css("width", addPercent + "%"); - }); } // Quick start @@ -419,6 +418,7 @@ function initRepository() { fullTextSearch: true, onChange: function (text, value, $choice) { window.location.href = $choice.data('url'); + console.log($choice.data('url')) }, message: {noResults: $branch_dropdown.data('no-results')} }); |