fixing space-indentation, modifying behaviour a little bit so that the maximized position is not saved, and minimizing can return back to the previous saved position

v1.18.x
Julian Lam 11 years ago
parent 517c70951f
commit b338ac2a4c

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

Loading…
Cancel
Save