From c3e4d11f696cf8fb6afe11cb6776123e965913bb Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 24 Jun 2014 15:49:55 -0400 Subject: [PATCH] closes #1719 --- public/language/en_GB/topic.json | 4 ---- public/src/modules/composer.js | 32 +++++++++++++++++--------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/public/language/en_GB/topic.json b/public/language/en_GB/topic.json index b661f44872..dc1534b916 100644 --- a/public/language/en_GB/topic.json +++ b/public/language/en_GB/topic.json @@ -89,9 +89,6 @@ "fork_success": "Succesfully forked topic!", "composer.title_placeholder": "Enter your topic title here...", - "composer.write": "Write", - "composer.preview": "Preview", - "composer.help": "Help", "composer.discard": "Discard", "composer.submit": "Submit", "composer.replying_to": "Replying to %1", @@ -104,7 +101,6 @@ "composer.thumb_file_label": "Or upload a file", "composer.thumb_remove": "Clear fields", "composer.drag_and_drop_images": "Drag and Drop Images Here", - "composer.upload_instructions": "Upload images by dragging & dropping them.", "more_users_and_guests": "%1 more user(s) and %2 guest(s)", "more_users": "%1 more user(s)", diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index ea565e929c..b29baa07a6 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -277,12 +277,7 @@ define('composer', dependencies, function(taskbar, controls, uploads, formatting handleResize(postContainer); - socket.emit('modules.composer.renderHelp', function(err, html) { - if (!err && html && html.length > 0) { - postContainer.find('.help').html(html); - postContainer.find('[data-pane=".tab-help"]').parent().removeClass('hidden'); - } - }); + handleHelp(postContainer); $(window).trigger('action:composer.loaded', { post_uuid: post_uuid @@ -294,6 +289,18 @@ define('composer', dependencies, function(taskbar, controls, uploads, formatting }); } + function handleHelp(postContainer) { + var helpBtn = postContainer.find('.help'); + socket.emit('modules.composer.renderHelp', function(err, html) { + if (!err && html && html.length > 0) { + helpBtn.removeClass('hidden'); + helpBtn.on('click', function() { + bootbox.alert(html); + }); + } + }); + } + function updateTitle(postData, postContainer) { var titleEl = postContainer.find('.title'); @@ -402,9 +409,6 @@ define('composer', dependencies, function(taskbar, controls, uploads, formatting } if(config.hasImageUploadPlugin) { - if(env === 'md' || env === 'lg') { - postContainer.find('.upload-instructions').removeClass('hide'); - } postContainer.find('.img-upload-btn').removeClass('hide'); postContainer.find('#files.lt-ie9').removeClass('hide'); } @@ -430,12 +434,10 @@ define('composer', dependencies, function(taskbar, controls, uploads, formatting var h1 = postContainer.find('.title').outerHeight(true); var h2 = postContainer.find('.tags-container').outerHeight(true); var h3 = postContainer.find('.formatting-bar').outerHeight(true); - var h4 = postContainer.find('.nav-tabs').outerHeight(true); - var h5 = postContainer.find('.instructions').outerHeight(true); - var h6 = postContainer.find('.topic-thumb-container').outerHeight(true); - var h7 = $('.taskbar').height(); - var total = h1 + h2 + h3 + h4 + h5 + h6 + h7; - postContainer.find('.tab-content').css('height', postContainer.height() - total); + var h4 = postContainer.find('.topic-thumb-container').outerHeight(true); + var h5 = $('.taskbar').height(); + var total = h1 + h2 + h3 + h4 + h5; + postContainer.find('.write-preview-container').css('height', postContainer.height() - total); } function focusElements(post_uuid) {