Improved post sizing, added [F]ullscreen hotkey

This commit is contained in:
Marcin Kurczewski
2015-03-13 09:29:26 +01:00
parent 65bc6705d3
commit eb3b02c28d
5 changed files with 72 additions and 32 deletions

View File

@ -45,8 +45,8 @@ App.Presenters.PostContentPresenter = function(
}
function updatePostNotesSize() {
$target.find('.post-notes-target').width($target.find('.image-wrapper').outerWidth());
$target.find('.post-notes-target').height($target.find('.image-wrapper').outerHeight());
$target.find('.post-notes-target').width($target.find('.object-wrapper').outerWidth());
$target.find('.post-notes-target').height($target.find('.object-wrapper').outerHeight());
}
function addNewPostNote() {
@ -57,6 +57,7 @@ App.Presenters.PostContentPresenter = function(
init: init,
render: render,
addNewPostNote: addNewPostNote,
updatePostNotesSize: updatePostNotesSize,
};
};

View File

@ -134,6 +134,18 @@ App.Presenters.PostPresenter = function(
editButtonClicked(null);
});
keyboard.keyup('f', function() {
var $wrapper = $el.find('.object-wrapper');
if ($wrapper.data('full')) {
$wrapper.css({maxWidth: $wrapper.attr('data-width') + 'px', width: 'auto'});
$wrapper.data('full', false);
} else {
$wrapper.css({maxWidth: null, width: $wrapper.attr('data-width')});
$wrapper.data('full', true);
}
postContentPresenter.updatePostNotesSize();
});
attachSidebarEvents();
attachLinksToPostsAround();