|
|
|
@ -382,15 +382,17 @@ define('composer', [
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
bodyEl.val(draft ? draft : postData.body);
|
|
|
|
|
|
|
|
|
|
preview.render(postContainer, function() {
|
|
|
|
|
preview.matchScroll(postContainer);
|
|
|
|
|
});
|
|
|
|
|
preview.handleToggler(postContainer);
|
|
|
|
|
|
|
|
|
|
drafts.init(postContainer, postData);
|
|
|
|
|
|
|
|
|
|
resize.handleResize(postContainer);
|
|
|
|
|
|
|
|
|
|
handleHelp(postContainer);
|
|
|
|
|
handleTogglePreview(postContainer);
|
|
|
|
|
|
|
|
|
|
$(window).trigger('action:composer.loaded', {
|
|
|
|
|
post_uuid: post_uuid
|
|
|
|
@ -419,27 +421,6 @@ define('composer', [
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleTogglePreview(postContainer) {
|
|
|
|
|
var showBtn = postContainer.find('.write-container .toggle-preview'),
|
|
|
|
|
hideBtn = postContainer.find('.preview-container .toggle-preview');
|
|
|
|
|
|
|
|
|
|
hideBtn.on('click', function() {
|
|
|
|
|
$('.preview-container').addClass('hide');
|
|
|
|
|
$('.write-container').addClass('maximized');
|
|
|
|
|
showBtn.removeClass('hide');
|
|
|
|
|
|
|
|
|
|
$('.write').focus();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
showBtn.on('click', function() {
|
|
|
|
|
$('.preview-container').removeClass('hide');
|
|
|
|
|
$('.write-container').removeClass('maximized');
|
|
|
|
|
showBtn.addClass('hide');
|
|
|
|
|
|
|
|
|
|
$('.write').focus();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateTitle(postData, postContainer) {
|
|
|
|
|
var titleEl = postContainer.find('.title');
|
|
|
|
|
|
|
|
|
|