mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-07 02:39:31 +01:00
avoid for-in
Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
aa9cd80da7
commit
2af9a6f9d4
1 changed files with 4 additions and 4 deletions
|
@ -2971,11 +2971,11 @@ function showDeletePopup() {
|
|||
|
||||
const dialog = $(`.delete.modal${filter}`);
|
||||
dialog.find('.name').text($this.data('name'));
|
||||
for (const key of Object.keys(dataArray)) {
|
||||
Object.keys(dataArray).forEach((key) => {
|
||||
if (key && key.startsWith('data')) {
|
||||
dialog.find(`.${key}`).text(dataArray[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.modal({
|
||||
closable: false,
|
||||
|
@ -2988,14 +2988,14 @@ function showDeletePopup() {
|
|||
const postData = {
|
||||
_csrf: csrf,
|
||||
};
|
||||
for (const key of Object.keys(dataArray)) {
|
||||
Object.keys(dataArray).forEach((key) => {
|
||||
if (key && key.startsWith('data')) {
|
||||
postData[key.substr(4)] = dataArray[key];
|
||||
}
|
||||
if (key === 'id') {
|
||||
postData['id'] = dataArray['id'];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$.post($this.data('url'), postData).done((data) => {
|
||||
window.location.href = data.redirect;
|
||||
|
|
Loading…
Reference in a new issue