forked from forgejo/forgejo
work on #470 and fix miror JS issue when choose targets on compare and pull
This commit is contained in:
parent
706b0f72e2
commit
7d72c8333e
7 changed files with 26 additions and 18 deletions
|
@ -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')}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue