Node.js based forum software built for the modern web
fixed drag and drop image upload
psychobunnya6796479bfe8
diff --git a/public/src/modules/coverPhoto.js b/public/src/modules/coverPhoto.jsindex d5ca6c0142..2c8f2db96b 100644--- a/public/src/modules/coverPhoto.js+++ b/public/src/modules/coverPhoto.js@@ -17,22 +17,25 @@ define('coverPhoto', [coverPhoto.getFn = getFn;coverPhoto.saveFn = saveFn;- coverEl.find('.change').on('click', function() {+ coverEl.find('.upload').on('click', function() {uploader.open(RELATIVE_PATH + '/api/groups/uploadpicture', { groupName: 'administrators' }, 0, function(imageUrlOnServer) {- console.log(imageUrlOnServer);coverPhoto.coverEl.css('background-image', 'url(' + imageUrlOnServer + '?' + new Date().getTime() + ')');});+ });- return;- coverEl.toggleClass('active', 1);- coverEl.backgroundDraggable({- axis: 'y',- units: 'percent'- });- coverEl.on('dragover', coverPhoto.onDragOver);- coverEl.on('drop', coverPhoto.onDrop);+ coverEl.find('.resize').on('click', function() {+ coverEl+ .toggleClass('active', 1)+ .backgroundDraggable({+ axis: 'y',+ units: 'percent'+ })});+ coverEl+ .on('dragover', coverPhoto.onDragOver)+ .on('drop', coverPhoto.onDrop);+coverEl.find('.save').on('click', coverPhoto.save);coverEl.addClass('initialised');};@@ -75,6 +78,13 @@ define('coverPhoto', [};reader.readAsDataURL(files[0]);++ coverPhoto.coverEl+ .addClass('active', 1)+ .backgroundDraggable({+ axis: 'y',+ units: 'percent'+ })}};