diff options
| -rw-r--r-- | public/js/home.js | 9 |
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; - }); }; |