mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-18 03:31:03 +01:00
remove dupe code
This commit is contained in:
@@ -16,12 +16,7 @@ define('coverPhoto', [
|
||||
|
||||
coverEl.find('.upload').on('click', uploadFn);
|
||||
coverEl.find('.resize').on('click', function() {
|
||||
coverEl
|
||||
.toggleClass('active', 1)
|
||||
.backgroundDraggable({
|
||||
axis: 'y',
|
||||
units: 'percent'
|
||||
});
|
||||
enableDragging(coverEl);
|
||||
});
|
||||
coverEl.find('.remove').on('click', removeFn);
|
||||
|
||||
@@ -53,16 +48,18 @@ define('coverPhoto', [
|
||||
};
|
||||
|
||||
reader.readAsDataURL(files[0]);
|
||||
|
||||
coverPhoto.coverEl
|
||||
.addClass('active', 1)
|
||||
.backgroundDraggable({
|
||||
axis: 'y',
|
||||
units: 'percent'
|
||||
});
|
||||
enableDragging(coverPhoto.coverEl);
|
||||
}
|
||||
};
|
||||
|
||||
function enableDragging(coverEl) {
|
||||
coverEl.toggleClass('active', 1)
|
||||
.backgroundDraggable({
|
||||
axis: 'y',
|
||||
units: 'percent'
|
||||
});
|
||||
}
|
||||
|
||||
coverPhoto.save = function() {
|
||||
coverPhoto.coverEl.addClass('saving');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user