mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Changed post notes to work with %-based coords
This commit is contained in:
@ -2,6 +2,7 @@ var App = App || {};
|
||||
App.Presenters = App.Presenters || {};
|
||||
|
||||
App.Presenters.PostContentPresenter = function(
|
||||
jQuery,
|
||||
util,
|
||||
promise,
|
||||
presenterManager,
|
||||
@ -31,9 +32,10 @@ App.Presenters.PostContentPresenter = function(
|
||||
|
||||
if (post.contentType === 'image') {
|
||||
loadPostNotes();
|
||||
$target.find('.post-notes-target').width($target.find('.image-wrapper').outerWidth());
|
||||
$target.find('.post-notes-target').height($target.find('.image-wrapper').outerHeight());
|
||||
updatePostNotesSize();
|
||||
}
|
||||
|
||||
jQuery(window).resize(updatePostNotesSize);
|
||||
}
|
||||
|
||||
function loadPostNotes() {
|
||||
@ -42,6 +44,11 @@ App.Presenters.PostContentPresenter = function(
|
||||
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());
|
||||
}
|
||||
|
||||
function addNewPostNote() {
|
||||
postNotesPresenter.addNewPostNote();
|
||||
}
|
||||
@ -55,6 +62,7 @@ App.Presenters.PostContentPresenter = function(
|
||||
};
|
||||
|
||||
App.DI.register('postContentPresenter', [
|
||||
'jQuery',
|
||||
'util',
|
||||
'promise',
|
||||
'presenterManager',
|
||||
|
Reference in New Issue
Block a user