Skip to content

Commit 68a506e

Browse files
committed
fix Snapshot admin actions buttons submitting on Safari
1 parent 5a9f272 commit 68a506e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

archivebox/templates/admin/base.html

+7-3
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,18 @@ <h1 id="site-name">
148148
$('<button>')
149149
.appendTo(buttons)
150150
.attr('name', this.value)
151+
.attr('type', 'button')
151152
.addClass('button')
152153
.text(this.text)
153-
.click(function () {
154+
.click(function (e) {
155+
e.preventDefault()
156+
e.stopPropagation()
154157
container.find('select')
155-
.find(':selected').attr('selected', '').end()
156-
.find('[value=' + this.name + ']').attr('selected', 'selected');
158+
.find(':selected').removeAttr('selected').end()
159+
.find('[value=' + name + ']').attr('selected', 'selected').click();
157160
$('#changelist-form button[name="index"]').click();
158161
document.querySelector('#logo').outerHTML = '<div class="loader"></div>'
162+
return false
159163
});
160164
});
161165
}

0 commit comments

Comments
 (0)