psychobunny 11 years ago
parent 2688ea9733
commit b43602f5b6

@ -5,7 +5,8 @@
define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'composer/formatting', 'composer/drafts', 'composer/tags'], function(taskbar, controls, uploads, formatting, drafts, tags) { define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'composer/formatting', 'composer/drafts', 'composer/tags'], function(taskbar, controls, uploads, formatting, drafts, tags) {
var composer = { var composer = {
active: undefined, active: undefined,
posts: {} posts: {},
bsEnvironment: undefined
}; };
socket.on('event:composer.ping', function(post_uuid) { socket.on('event:composer.ping', function(post_uuid) {
@ -179,9 +180,10 @@ define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'compose
var allowTopicsThumbnail = config.allowTopicsThumbnail && composer.posts[post_uuid].isMain && (config.hasImageUploadPlugin || config.allowFileUploads); var allowTopicsThumbnail = config.allowTopicsThumbnail && composer.posts[post_uuid].isMain && (config.hasImageUploadPlugin || config.allowFileUploads);
var isTopic = composer.posts[post_uuid] ? !!composer.posts[post_uuid].cid : false; var isTopic = composer.posts[post_uuid] ? !!composer.posts[post_uuid].cid : false;
var isMain = composer.posts[post_uuid] ? !!composer.posts[post_uuid].isMain : false; var isMain = composer.posts[post_uuid] ? !!composer.posts[post_uuid].isMain : false;
var bsEnvironment = utils.findBootstrapEnvironment();
var template = (bsEnvironment === 'xs' || bsEnvironment === 'sm') ? 'composer-mobile' : 'composer'; composer.bsEnvironment = utils.findBootstrapEnvironment()
var template = (composer.bsEnvironment === 'xs' || composer.bsEnvironment === 'sm') ? 'composer-mobile' : 'composer';
templates.parse(template, {allowTopicsThumbnail: allowTopicsThumbnail, showTags: isTopic || isMain}, function(composerTemplate) { templates.parse(template, {allowTopicsThumbnail: allowTopicsThumbnail, showTags: isTopic || isMain}, function(composerTemplate) {
translator.translate(composerTemplate, function(composerTemplate) { translator.translate(composerTemplate, function(composerTemplate) {
@ -375,7 +377,7 @@ define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'compose
postContainer = $('#cmp-uuid-' + post_uuid); postContainer = $('#cmp-uuid-' + post_uuid);
composer.active = post_uuid; composer.active = post_uuid;
var env = utils.findBootstrapEnvironment(); var env = composer.bsEnvironment;
if (percentage) { if (percentage) {
if ( env === 'md' || env === 'lg') { if ( env === 'md' || env === 'lg') {
@ -405,7 +407,10 @@ define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'compose
$('body').css({'margin-bottom': postContainer.css('height')}); $('body').css({'margin-bottom': postContainer.css('height')});
focusElements(post_uuid); if (env !== 'sm' && env !== 'xs') {
focusElements(post_uuid);
}
resizeTabContent(postContainer); resizeTabContent(postContainer);
} }

Loading…
Cancel
Save