Moved [F]ullscreen hotkey to PostContentPresenter

This commit is contained in:
rr- 2015-07-19 10:58:50 +02:00
parent 6b6acb0bbf
commit 64ae9a7c74
2 changed files with 14 additions and 13 deletions

View file

@ -5,6 +5,7 @@ App.Presenters.PostContentPresenter = function(
jQuery,
util,
promise,
keyboard,
presenterManager,
postNotesPresenter) {
@ -35,6 +36,18 @@ App.Presenters.PostContentPresenter = function(
updatePostNotesSize();
}
keyboard.keyup('f', function() {
var $wrapper = $target.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);
}
updatePostNotesSize();
});
jQuery(window).resize(updatePostNotesSize);
}
@ -72,6 +85,7 @@ App.DI.register('postContentPresenter', [
'jQuery',
'util',
'promise',
'keyboard',
'presenterManager',
'postNotesPresenter'],
App.Presenters.PostContentPresenter);

View file

@ -135,20 +135,7 @@ 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();
}