refactored write preview code

v1.18.x
psychobunny 10 years ago
parent da758c429a
commit bd99124fb9

@ -143,12 +143,17 @@ define('composer/resize', function() {
function resizeWritePreview(postContainer) { function resizeWritePreview(postContainer) {
var h1 = postContainer.find('.title-container').outerHeight(true); var rows = [
var h2 = postContainer.find('.category-tag-row').outerHeight(true); postContainer.find('.title-container').outerHeight(true),
var h3 = postContainer.find('.formatting-bar').outerHeight(true); postContainer.find('.formatting-bar').outerHeight(true),
var h4 = postContainer.find('.topic-thumb-container').outerHeight(true); postContainer.find('.topic-thumb-container').outerHeight(true),
var h5 = $('.taskbar').height(); $('.taskbar').height()
var total = h1 + h2 + h3 + h4 + h5; ];
var total = rows.reduce(function(a, b) {
return a + b;
});
postContainer.find('.write-preview-container').css('height', postContainer.height() - total); postContainer.find('.write-preview-container').css('height', postContainer.height() - total);
} }

Loading…
Cancel
Save