Skip to content

Commit 3e9f082

Browse files
committed
Prevent removing all rows.
1 parent c9a75e8 commit 3e9f082

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

assets/src/js/admin/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ document.addEventListener('DOMContentLoaded', () => {
157157
input.setAttribute('id', target + '[' + current_row + ']');
158158
input.setAttribute('name', target + '[' + current_row + ']');
159159
trash.setAttribute('onclick', 'plausibleRemoveField("' + target + '[' + current_row + ']")');
160+
trash.classList.remove('hidden');
160161

161162
document.getElementById(target + '_list').appendChild(clone);
162163
},
@@ -174,7 +175,7 @@ document.addEventListener('DOMContentLoaded', () => {
174175

175176
listItem.remove();
176177

177-
plausible.resetListItems(rows, rowClass);
178+
plausible.resetListItems(rows, target.replace(/\[[0-9]+]/, ''));
178179
},
179180

180181
/**

0 commit comments

Comments
 (0)