From 35e72dbb373fb6e0b0453c750112a77055350942 Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 10 Jun 2014 14:45:48 -0400 Subject: [PATCH] load composer-mobile.tpl if in xs/sm environment, for https://github.com/NodeBB/NodeBB/issues/1657 --- public/src/modules/composer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index fa1f233c00..f8c05716c5 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -179,8 +179,11 @@ define('composer', ['taskbar', 'composer/controls', 'composer/uploads', 'compose 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 isMain = composer.posts[post_uuid] ? !!composer.posts[post_uuid].isMain : false; + var bsEnvironment = utils.findBootstrapEnvironment(); - templates.parse('composer', {allowTopicsThumbnail: allowTopicsThumbnail, showTags: isTopic || isMain}, function(composerTemplate) { + var template = (bsEnvironment === 'xs' || bsEnvironment === 'sm') ? 'composer-mobile' : 'composer'; + + templates.parse(template, {allowTopicsThumbnail: allowTopicsThumbnail, showTags: isTopic || isMain}, function(composerTemplate) { translator.translate(composerTemplate, function(composerTemplate) { composerTemplate = $(composerTemplate);