mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-24 13:20:56 +01:00
Option to upload without cropping (#5447)
* Option to upload without cropping * Fix styling * Fix styling * Add missing semi-colon * I fail at styling :fail:
This commit is contained in:
committed by
psychobunny
parent
867fd99fb6
commit
c25836b5fc
@@ -132,7 +132,7 @@
|
||||
}
|
||||
|
||||
#crop-picture-modal {
|
||||
.cropped-image {
|
||||
#cropped-image {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
|
||||
@@ -252,6 +252,9 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator',
|
||||
imageData: imageData
|
||||
}, function (err, imageData) {
|
||||
if (err) {
|
||||
cropperModal.find('#upload-progress-box').hide();
|
||||
cropperModal.find('.upload-btn').removeClass('disabled');
|
||||
cropperModal.find('.crop-btn').removeClass('disabled');
|
||||
app.alertError(err.message);
|
||||
}
|
||||
|
||||
@@ -259,6 +262,18 @@ define('forum/account/edit', ['forum/account/header', 'uploader', 'translator',
|
||||
cropperModal.modal('hide');
|
||||
});
|
||||
});
|
||||
|
||||
cropperModal.find('.upload-btn').on('click', function () {
|
||||
$(this).addClass('disabled');
|
||||
cropperTool.destroy();
|
||||
|
||||
cropperTool = new cropper.default(img, {
|
||||
viewMode: 1,
|
||||
autoCropArea: 1
|
||||
});
|
||||
|
||||
cropperModal.find('.crop-btn').trigger('click');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
|
||||
<button class="btn btn-primary upload-btn">[[user:upload_picture]]</button>
|
||||
<button class="btn btn-primary crop-btn">[[user:upload_cropped_picture]]</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user