commit 19867f6d082c62bad52c4224d521325a4eed129a
parent 4ff40330d1972451c66b0340ef1beecfa9f9264f
Author: Florian Kaldowski <flokX@users.noreply.github.com>
Date: Tue, 9 Apr 2019 09:16:55 +0200
Replace event listeners
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/admin/main.js b/admin/main.js
@@ -17,7 +17,7 @@ function post(url, data) {
});
}
-$('button#add-shortlink').click(function (event) {
+document.getElementById('add-shortlink').addEventListener('click', function (event) {
'use strict';
event.preventDefault();
spinner.style.display = '';
@@ -37,7 +37,7 @@ $('button#add-shortlink').click(function (event) {
});
spinner.style.display = 'none';
});
-$('a#refresh').click(function (event) {
+document.getElementById('refresh').addEventListener('click', function (event) {
'use strict';
event.preventDefault();
getCharts();
@@ -66,11 +66,11 @@ function getCharts() {
},
countLabel: 'Access(es)'
});
- $('a#export-' + name).click(function (event) {
+ document.getElementById('export-' + name).addEventListener('click', function (event) {
event.preventDefault();
heatmap.export();
});
- $('a#delete-' + name).click(function (event) {
+ document.getElementById('delete-' + name).addEventListener('click', function (event) {
event.preventDefault();
post('index.php?delete', {
name: name