aboutsummaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorPitu <[email protected]>2017-04-27 04:37:30 -0300
committerPitu <[email protected]>2017-04-27 04:37:30 -0300
commit9db6c23ce11f125df200326c3e4835b690cd011e (patch)
tree59d71cdaa0cc811d76caab0eeeac05a655d5dd3e /public/js
parentChanged the dropdown option and removed label (diff)
downloadhost.fuwn.me-9db6c23ce11f125df200326c3e4835b690cd011e.tar.xz
host.fuwn.me-9db6c23ce11f125df200326c3e4835b690cd011e.zip
Moved the eventListener
Diffstat (limited to 'public/js')
-rw-r--r--public/js/home.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/public/js/home.js b/public/js/home.js
index a9ca41c..9300452 100644
--- a/public/js/home.js
+++ b/public/js/home.js
@@ -65,6 +65,10 @@ upload.prepareUpload = function(){
if (upload.token) {
var select = document.querySelector('select');
+ select.addEventListener('change', function() {
+ upload.album = select.value;
+ });
+
axios.get('/api/albums', { headers: { token: upload.token }})
.then(function(res) {
var albums = res.data.albums;
@@ -187,10 +191,5 @@ window.addEventListener('paste', function(event) {
window.onload = function () {
upload.checkIfPublic();
-
- // eventlistener for the album select
- document.querySelector('select').addEventListener('change', function() {
- upload.album = document.querySelector('select').value;
- });
};