toggle preview button on composer

v1.18.x
psychobunny 10 years ago
parent 8484c7c51a
commit eb733fdb6f

@ -348,6 +348,7 @@ define('composer', [
resize.handleResize(postContainer); resize.handleResize(postContainer);
handleHelp(postContainer); handleHelp(postContainer);
handleToggle(postContainer);
$(window).trigger('action:composer.loaded', { $(window).trigger('action:composer.loaded', {
post_uuid: post_uuid post_uuid: post_uuid
@ -376,6 +377,23 @@ define('composer', [
}); });
} }
function handleToggle(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');
});
showBtn.on('click', function() {
$('.preview-container').removeClass('hide');
$('.write-container').removeClass('maximized');
showBtn.addClass('hide');
});
}
function updateTitle(postData, postContainer) { function updateTitle(postData, postContainer) {
var titleEl = postContainer.find('.title'); var titleEl = postContainer.find('.title');

Loading…
Cancel
Save