mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-14 00:34:12 +08:00
work on #470 and fix miror JS issue when choose targets on compare and pull
This commit is contained in:
conf/locale
modules
public/js
routers
templates
@ -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')}
|
||||
});
|
||||
|
Reference in New Issue
Block a user