cleaned up resizeStop

v1.18.x
barisusakli 11 years ago
parent 9aacb5e259
commit 56830d773e

@ -52,28 +52,32 @@ define('composer/resize', function() {
}
function resizeStop(e) {
var triggerIconEl = $('.resizer i');
resizeActive = false;
if (e.clientY-resizeDown === 0){
toggleHeight(e);
postContainer.find('textarea').focus();
$(window).off('mousemove', resizeAction);
$(window).off('mouseup', resizeStop);
$('body').off('touchmove', resizeTouchAction);
}
function toggleHeight(e) {
var triggerIconEl = $('.resizer i');
if (e.clientY - resizeDown === 0){
var newHeight;
var max = $(window).height() - $('#header-menu').height() - 20;
if (max != postContainer.height()){
if (max !== postContainer.height()){
postContainer.css('height', max);
$('body').css({'margin-bottom': max});
resizeWritePreview(postContainer);
triggerIconEl.addClass("fa-chevron-down").removeClass("fa-chevron-up");
triggerIconEl.addClass('fa-chevron-down').removeClass('fa-chevron-up');
} else {
resize.reposition(postContainer);
triggerIconEl.addClass("fa-chevron-up").removeClass("fa-chevron-down");
triggerIconEl.addClass('fa-chevron-up').removeClass('fa-chevron-down');
}
} else {
triggerIconEl.addClass("fa-chevron-up").removeClass("fa-chevron-down");
triggerIconEl.addClass('fa-chevron-up').removeClass('fa-chevron-down');
}
postContainer.find('textarea').focus();
$(window).off('mousemove', resizeAction);
$(window).off('mouseup', resizeStop);
$('body').off('touchmove', resizeTouchAction);
}
function resizeTouchAction(e) {

Loading…
Cancel
Save