diff options
author | Yixin Hao <haoyixin@live.cn> | 2015-08-21 15:27:38 +0800 |
---|---|---|
committer | Yixin Hao <haoyixin@live.cn> | 2015-08-21 15:27:38 +0800 |
commit | 50cd67cd4bf9e03a555cbf44bcd76ca12a315b97 (patch) | |
tree | 55a8e7dc63ae4a8171be2874fb3f2e285b1607ee /public/js/gogs.js | |
parent | 78b717f202dd989f3871fccd0bc8935fe709fac1 (diff) | |
parent | 461f715ae4699557571652d9d3baec9a4438796f (diff) |
Merge pull request #2 from gogits/develop
Update Develop
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r-- | public/js/gogs.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/public/js/gogs.js b/public/js/gogs.js index 98b1e336..2193101d 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -339,6 +339,25 @@ function initRepository() { }) } + // Diff + if ($('.repository.diff').length > 0) { + $('.diff-detail-box .toggle.button').click(function () { + $($(this).data('target')).slideToggle(100); + }) + + var $counter = $('.diff-counter'); + if ($counter.length < 1) { + return; + } + $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 + "%"); + }); + } + // Pull request if ($('.repository.compare.pull').length > 0) { var $branch_dropdown = $('.choose.branch .dropdown') |