|
@@ -184,11 +184,11 @@ function initBranchSelector() { |
|
|
}); |
|
|
}); |
|
|
$selectBranch.find('.reference.column').on('click', function () { |
|
|
$selectBranch.find('.reference.column').on('click', function () { |
|
|
$selectBranch.find('.scrolling.reference-list-menu').css('display', 'none'); |
|
|
$selectBranch.find('.scrolling.reference-list-menu').css('display', 'none'); |
|
|
$selectBranch.find('.reference .text').removeClass('black'); |
|
|
|
|
|
|
|
|
$selectBranch.find('.reference .text').addClass('black'); |
|
|
$($(this).data('target')).css('display', 'block'); |
|
|
$($(this).data('target')).css('display', 'block'); |
|
|
$(this) |
|
|
$(this) |
|
|
.find('.text') |
|
|
|
|
|
.addClass('black'); |
|
|
|
|
|
|
|
|
.find('.text.black') |
|
|
|
|
|
.removeClass('black'); |
|
|
return false; |
|
|
return false; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@@ -231,7 +231,7 @@ function initLabelEdit() { |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function updateIssuesMeta(url, action, issueIds, elementId, isAdd) { |
|
|
|
|
|
|
|
|
function updateIssuesMeta(url, action, issueIds, elementId, isAdd,ref_b) { |
|
|
return new Promise((resolve) => { |
|
|
return new Promise((resolve) => { |
|
|
$.ajax({ |
|
|
$.ajax({ |
|
|
type: 'POST', |
|
|
type: 'POST', |
|
@@ -241,7 +241,8 @@ function updateIssuesMeta(url, action, issueIds, elementId, isAdd) { |
|
|
action, |
|
|
action, |
|
|
issue_ids: issueIds, |
|
|
issue_ids: issueIds, |
|
|
id: elementId, |
|
|
id: elementId, |
|
|
is_add: isAdd |
|
|
|
|
|
|
|
|
is_add: isAdd, |
|
|
|
|
|
ref: ref_b, |
|
|
}, |
|
|
}, |
|
|
success: resolve |
|
|
success: resolve |
|
|
}); |
|
|
}); |
|
@@ -487,12 +488,14 @@ function initCommentForm() { |
|
|
const promises = []; |
|
|
const promises = []; |
|
|
Object.keys(labels).forEach((elementId) => { |
|
|
Object.keys(labels).forEach((elementId) => { |
|
|
const label = labels[elementId]; |
|
|
const label = labels[elementId]; |
|
|
|
|
|
console.log("label:",label) |
|
|
const promise = updateIssuesMeta( |
|
|
const promise = updateIssuesMeta( |
|
|
label['update-url'], |
|
|
label['update-url'], |
|
|
label.action, |
|
|
label.action, |
|
|
label['issue-id'], |
|
|
label['issue-id'], |
|
|
elementId, |
|
|
elementId, |
|
|
label['is-checked'] |
|
|
|
|
|
|
|
|
label['is-checked'], |
|
|
|
|
|
'' |
|
|
); |
|
|
); |
|
|
promises.push(promise); |
|
|
promises.push(promise); |
|
|
}); |
|
|
}); |
|
@@ -526,13 +529,19 @@ function initCommentForm() { |
|
|
.removeClass('invisible'); |
|
|
.removeClass('invisible'); |
|
|
$(this).data('is-checked', 'add'); |
|
|
$(this).data('is-checked', 'add'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log("$(this)",$(this)) |
|
|
|
|
|
console.log("$listMenu",$listMenu) |
|
|
|
|
|
const isRef = ''; |
|
|
|
|
|
// if ($listMenu.data('update-url').includes("ref")){ |
|
|
|
|
|
// isRef = $(this).data('data-name'); |
|
|
|
|
|
// } |
|
|
updateIssuesMeta( |
|
|
updateIssuesMeta( |
|
|
$listMenu.data('update-url'), |
|
|
$listMenu.data('update-url'), |
|
|
'', |
|
|
'', |
|
|
$listMenu.data('issue-id'), |
|
|
$listMenu.data('issue-id'), |
|
|
$(this).data('id'), |
|
|
$(this).data('id'), |
|
|
$(this).data('is-checked') |
|
|
|
|
|
|
|
|
$(this).data('is-checked'), |
|
|
|
|
|
'' |
|
|
); |
|
|
); |
|
|
$listMenu.data('action', 'update'); // Update to reload the page when we updated items |
|
|
$listMenu.data('action', 'update'); // Update to reload the page when we updated items |
|
|
return false; |
|
|
return false; |
|
@@ -603,7 +612,8 @@ function initCommentForm() { |
|
|
'clear', |
|
|
'clear', |
|
|
$listMenu.data('issue-id'), |
|
|
$listMenu.data('issue-id'), |
|
|
'', |
|
|
'', |
|
|
'' |
|
|
|
|
|
|
|
|
'', |
|
|
|
|
|
'', |
|
|
).then(reload); |
|
|
).then(reload); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -637,10 +647,16 @@ function initCommentForm() { |
|
|
initListSubmits('select-reviewers-modify', 'assignees'); |
|
|
initListSubmits('select-reviewers-modify', 'assignees'); |
|
|
|
|
|
|
|
|
function selectItem(select_id, input_id) { |
|
|
function selectItem(select_id, input_id) { |
|
|
const $menu = $(`${select_id} .menu`); |
|
|
|
|
|
|
|
|
let $menu; |
|
|
|
|
|
if (select_id=='.select-branch'){ |
|
|
|
|
|
$menu = $(`${select_id} .menu`).eq(1); |
|
|
|
|
|
}else{ |
|
|
|
|
|
$menu = $(`${select_id} .menu`); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
const $list = $(`.ui${select_id}.list`); |
|
|
const $list = $(`.ui${select_id}.list`); |
|
|
const hasUpdateAction = $menu.data('action') === 'update'; |
|
|
const hasUpdateAction = $menu.data('action') === 'update'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$menu.find('.item:not(.no-select)').on('click', function () { |
|
|
$menu.find('.item:not(.no-select)').on('click', function () { |
|
|
$(this) |
|
|
$(this) |
|
|
.parent() |
|
|
.parent() |
|
@@ -651,12 +667,19 @@ function initCommentForm() { |
|
|
|
|
|
|
|
|
$(this).addClass('selected active'); |
|
|
$(this).addClass('selected active'); |
|
|
if (hasUpdateAction) { |
|
|
if (hasUpdateAction) { |
|
|
|
|
|
let ref = '' |
|
|
|
|
|
if (select_id=='.select-branch'){ |
|
|
|
|
|
ref = $(this).data('name'); |
|
|
|
|
|
console.log("ref:",ref) |
|
|
|
|
|
} |
|
|
|
|
|
console.log("ref:",ref) |
|
|
updateIssuesMeta( |
|
|
updateIssuesMeta( |
|
|
$menu.data('update-url'), |
|
|
$menu.data('update-url'), |
|
|
'', |
|
|
'', |
|
|
$menu.data('issue-id'), |
|
|
$menu.data('issue-id'), |
|
|
$(this).data('id'), |
|
|
$(this).data('id'), |
|
|
$(this).data('is-checked') |
|
|
|
|
|
|
|
|
$(this).data('is-checked'), |
|
|
|
|
|
ref |
|
|
).then(reload); |
|
|
).then(reload); |
|
|
} |
|
|
} |
|
|
switch (input_id) { |
|
|
switch (input_id) { |
|
@@ -696,7 +719,8 @@ function initCommentForm() { |
|
|
'', |
|
|
'', |
|
|
$menu.data('issue-id'), |
|
|
$menu.data('issue-id'), |
|
|
$(this).data('id'), |
|
|
$(this).data('id'), |
|
|
$(this).data('is-checked') |
|
|
|
|
|
|
|
|
$(this).data('is-checked'), |
|
|
|
|
|
'' |
|
|
).then(reload); |
|
|
).then(reload); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -709,6 +733,7 @@ function initCommentForm() { |
|
|
// Milestone and assignee |
|
|
// Milestone and assignee |
|
|
selectItem('.select-milestone', '#milestone_id'); |
|
|
selectItem('.select-milestone', '#milestone_id'); |
|
|
selectItem('.select-assignee', '#assignee_id'); |
|
|
selectItem('.select-assignee', '#assignee_id'); |
|
|
|
|
|
selectItem('.select-branch', ''); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function initInstall() { |
|
|
function initInstall() { |
|
@@ -811,9 +836,9 @@ function initIssueComments() { |
|
|
const issueId = $(this).data('issue-id'); |
|
|
const issueId = $(this).data('issue-id'); |
|
|
const id = $(this).data('id'); |
|
|
const id = $(this).data('id'); |
|
|
const isChecked = $(this).data('is-checked'); |
|
|
const isChecked = $(this).data('is-checked'); |
|
|
|
|
|
|
|
|
|
|
|
const ref = $(this).data('name'); |
|
|
event.preventDefault(); |
|
|
event.preventDefault(); |
|
|
updateIssuesMeta(url, '', issueId, id, isChecked).then(reload); |
|
|
|
|
|
|
|
|
updateIssuesMeta(url, '', issueId, id, isChecked,ref).then(reload); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
$(document).on('click', (event) => { |
|
|
$(document).on('click', (event) => { |
|
@@ -2900,12 +2925,13 @@ $(document).ready(async () => { |
|
|
}) |
|
|
}) |
|
|
.get() |
|
|
.get() |
|
|
.join(); |
|
|
.join(); |
|
|
const {url} = this.dataset; |
|
|
|
|
|
|
|
|
console.log("this:",this) |
|
|
|
|
|
|
|
|
if (elementId === '0' && url.substr(-9) === '/assignee') { |
|
|
if (elementId === '0' && url.substr(-9) === '/assignee') { |
|
|
elementId = ''; |
|
|
elementId = ''; |
|
|
action = 'clear'; |
|
|
action = 'clear'; |
|
|
} |
|
|
} |
|
|
updateIssuesMeta(url, action, issueIDs, elementId, '').then(() => { |
|
|
|
|
|
|
|
|
updateIssuesMeta(url, action, issueIDs, elementId, '','').then(() => { |
|
|
// NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the checkboxes stay checked after reload |
|
|
// NOTICE: This reset of checkbox state targets Firefox caching behaviour, as the checkboxes stay checked after reload |
|
|
if (action === 'close' || action === 'open') { |
|
|
if (action === 'close' || action === 'open') { |
|
|
// uncheck all checkboxes |
|
|
// uncheck all checkboxes |
|
|