remove dupe code

v1.18.x
barisusakli 9 years ago
parent 27f77bf832
commit 3bd83cd732

@ -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');

Loading…
Cancel
Save