Changed post notes to work with %-based coords

This commit is contained in:
Marcin Kurczewski
2014-10-26 12:39:55 +01:00
parent 03ce73b1a5
commit 42039ddf26
9 changed files with 57 additions and 46 deletions

View File

@ -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',