|
|
@ -292,12 +292,10 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
postContainer.find('.nav-tabs a').on('shown.bs.tab', function (e) {
|
|
|
|
bodyEl.on('blur', function() {
|
|
|
|
if($(e.target).attr('data-pane') === '.tab-preview') {
|
|
|
|
socket.emit('modules.composer.renderPreview', bodyEl.val(), function(err, preview) {
|
|
|
|
socket.emit('modules.composer.renderPreview', bodyEl.val(), function(err, preview) {
|
|
|
|
postContainer.find('.preview').html(preview);
|
|
|
|
postContainer.find('.preview').html(preview);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -305,20 +303,19 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
resizeCenterY = 0,
|
|
|
|
resizeCenterY = 0,
|
|
|
|
resizeOffset = 0,
|
|
|
|
resizeOffset = 0,
|
|
|
|
resizeStart = function(e) {
|
|
|
|
resizeStart = function(e) {
|
|
|
|
bodyRect = document.body.getBoundingClientRect();
|
|
|
|
|
|
|
|
resizeRect = resizeEl.getBoundingClientRect();
|
|
|
|
resizeRect = resizeEl.getBoundingClientRect();
|
|
|
|
resizeCenterY = resizeRect.top + (resizeRect.height/2);
|
|
|
|
resizeCenterY = resizeRect.top + (resizeRect.height/2);
|
|
|
|
resizeOffset = resizeCenterY - e.clientY;
|
|
|
|
resizeOffset = resizeCenterY - e.clientY;
|
|
|
|
resizeActive = true;
|
|
|
|
resizeActive = true;
|
|
|
|
|
|
|
|
|
|
|
|
$(document.body).on('mousemove', resizeAction);
|
|
|
|
$(window).on('mousemove', resizeAction);
|
|
|
|
$(document.body).on('mouseup', resizeStop);
|
|
|
|
$(window).on('mouseup', resizeStop);
|
|
|
|
document.body.addEventListener('touchmove', resizeTouchAction);
|
|
|
|
document.body.addEventListener('touchmove', resizeTouchAction);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
resizeStop = function() {
|
|
|
|
resizeStop = function() {
|
|
|
|
resizeActive = false;
|
|
|
|
resizeActive = false;
|
|
|
|
$(document.body).off('mousemove', resizeAction);
|
|
|
|
$(window).off('mousemove', resizeAction);
|
|
|
|
$(document.body).off('mouseup', resizeStop);
|
|
|
|
$(window).off('mouseup', resizeStop);
|
|
|
|
document.body.removeEventListener('touchmove', resizeTouchAction);
|
|
|
|
document.body.removeEventListener('touchmove', resizeTouchAction);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
resizeTouchAction = function(e) {
|
|
|
|
resizeTouchAction = function(e) {
|
|
|
@ -328,17 +325,21 @@ define(['taskbar'], function(taskbar) {
|
|
|
|
resizeAction = function(e) {
|
|
|
|
resizeAction = function(e) {
|
|
|
|
if (resizeActive) {
|
|
|
|
if (resizeActive) {
|
|
|
|
position = (e.clientY + resizeOffset);
|
|
|
|
position = (e.clientY + resizeOffset);
|
|
|
|
|
|
|
|
var newHeight = $(window).height() - position;
|
|
|
|
postContainer.css('height', $(window).height() - position);
|
|
|
|
if(newHeight > $(window).height() - $('#header-menu').height() - 20) {
|
|
|
|
resizeSavePosition($(window).height() - position);
|
|
|
|
newHeight = $(window).height() - $('#header-menu').height() - 20;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
postContainer.css('height', newHeight);
|
|
|
|
|
|
|
|
resizeSavePosition(newHeight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
resizeSavePosition = function(px) {
|
|
|
|
resizeSavePosition = function(px) {
|
|
|
|
var percentage = px / $(window).height();
|
|
|
|
var percentage = px / $(window).height();
|
|
|
|
localStorage.setItem('composer:resizePercentage', percentage);
|
|
|
|
localStorage.setItem('composer:resizePercentage', percentage);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
resizeRect, bodyRect;
|
|
|
|
resizeRect;
|
|
|
|
|
|
|
|
|
|
|
|
var resizeEl = postContainer.find('.resizer')[0];
|
|
|
|
var resizeEl = postContainer.find('.resizer')[0];
|
|
|
|
|
|
|
|
|
|
|
|