mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Fixed post resizing, alignment etc.
This commit is contained in:
@ -41,7 +41,14 @@ App.Presenters.HomePresenter = function(
|
||||
if ($el.find('#post-content-target').length > 0) {
|
||||
presenterManager.initPresenters([
|
||||
[postContentPresenter, {post: post, $target: $el.find('#post-content-target')}]],
|
||||
function() {});
|
||||
function() {
|
||||
var $wrapper = $el.find('.object-wrapper');
|
||||
$wrapper.css({
|
||||
maxWidth: $wrapper.attr('data-width') + 'px',
|
||||
width: 'auto',
|
||||
margin: '0 auto'});
|
||||
postContentPresenter.updatePostNotesSize();
|
||||
});
|
||||
}
|
||||
|
||||
}).fail(function(response) {
|
||||
|
@ -45,8 +45,14 @@ App.Presenters.PostContentPresenter = function(
|
||||
}
|
||||
|
||||
function updatePostNotesSize() {
|
||||
$target.find('.post-notes-target').width($target.find('.object-wrapper').outerWidth());
|
||||
$target.find('.post-notes-target').height($target.find('.object-wrapper').outerHeight());
|
||||
var $postNotes = $target.find('.post-notes-target');
|
||||
var $objectWrapper = $target.find('.object-wrapper');
|
||||
$postNotes.css({
|
||||
width: $objectWrapper.outerWidth() + 'px',
|
||||
height: $objectWrapper.outerHeight() + 'px',
|
||||
left: ($objectWrapper.offset().left - $objectWrapper.parent().offset().left) + 'px',
|
||||
top: ($objectWrapper.offset().top - $objectWrapper.parent().offset().top) + 'px',
|
||||
});
|
||||
}
|
||||
|
||||
function addNewPostNote() {
|
||||
|
Reference in New Issue
Block a user