From 06bd47c0bed25779d679eab1385b74345f7f153b Mon Sep 17 00:00:00 2001 From: Peter Grassberger Date: Tue, 28 Jun 2016 01:17:12 +0200 Subject: uploadModal: hide input, fix duplicate events diff --git a/www/js/importer.js b/www/js/importer.js index 09f5db5..dd8913f 100644 --- a/www/js/importer.js +++ b/www/js/importer.js @@ -137,20 +137,20 @@ Rdxport.Importer.prototype.openModal = function(group, groupView, cartNumber, ne var $form = $('form', $drop); var $fileInput = $('input[type="file"]', $form); - $drop.on('click', function(event) { + $drop.off('click').on('click', function(event) { $fileInput.get(0).click(); }); - $fileInput.on('change', function() { + $fileInput.off('change').on('change', function() { handleFiles($(this).get(0).files); }); - $drop.on('dragenter dragover', function(event) { + $drop.off('dragenter dragover').on('dragenter dragover', function(event) { event.stopPropagation(); event.preventDefault(); }); - $drop.on('drop', function(event) { + $drop.off('drop').on('drop', function(event) { event.stopPropagation(); event.preventDefault(); var dataTransfer = event.dataTransfer; diff --git a/www/styles/main-style.css b/www/styles/main-style.css index 9ee1b83..b76c32f 100644 --- a/www/styles/main-style.css +++ b/www/styles/main-style.css @@ -94,6 +94,10 @@ body { background-position: center center; } +#uploadModal div.modal-body .drop form input { + display: none; +} + #uploadModal div.modal-body form { display: block; width: 100%; -- cgit v0.10.2