From ae9f675b80d718776d4a8b3bbfe5b4d429e88279 Mon Sep 17 00:00:00 2001 From: Micheil Smith Date: Sat, 19 Apr 2014 15:14:23 +0100 Subject: [PATCH] Composer: Use formatting dispatch table for inserting uploads and pictures --- public/src/modules/composer.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/src/modules/composer.js b/public/src/modules/composer.js index 7aa238b6a3..4972eaf3c3 100644 --- a/public/src/modules/composer.js +++ b/public/src/modules/composer.js @@ -496,6 +496,14 @@ define(['taskbar'], function(taskbar) { // Highlight "link url" updateTextareaSelection(textarea, selectionEnd + 3, selectionEnd + 11); } + }, + + 'fa fa-picture-o': function(){ + $('#files').click(); + }, + + 'fa fa-upload': function(){ + $('#files').click(); } }; @@ -721,10 +729,6 @@ define(['taskbar'], function(taskbar) { postContainer.on('click', '.formatting-bar span', handleFormattingBarClick); - postContainer.on('click', '.formatting-bar span .fa-picture-o, .formatting-bar span .fa-upload', function() { - $('#files').click(); - }); - postContainer.find('#files').on('change', function(e) { var files = (e.target || {}).files || ($(this).val() ? [{name: $(this).val(), type: utils.fileMimeType($(this).val())}] : null); if(files) {