From b513814e8a7a2692dfafbc90848c27fb978eca36 Mon Sep 17 00:00:00 2001 From: Pierre Date: Fri, 23 Jun 2017 17:25:29 +0200 Subject: [PATCH] Updated conversation send button --- assets/css/components/conversations/windows.css | 4 ++-- assets/js/components/conversations/chatWindows.js | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/assets/css/components/conversations/windows.css b/assets/css/components/conversations/windows.css index da0216c8..4c6c3218 100644 --- a/assets/css/components/conversations/windows.css +++ b/assets/css/components/conversations/windows.css @@ -25,8 +25,8 @@ } #conversationsElem .create-message-form .btn { - padding-left: 6px; - padding-right:6px; + padding-left: 8px; + padding-right:8px; } #conversationsElem .create-message-form .btn.btn-add-image { diff --git a/assets/js/components/conversations/chatWindows.js b/assets/js/components/conversations/chatWindows.js index 0885681e..bf6b9219 100644 --- a/assets/js/components/conversations/chatWindows.js +++ b/assets/js/components/conversations/chatWindows.js @@ -180,12 +180,18 @@ ComunicWeb.components.conversations.chatWindows = { //Add send button var sendButton = createElem2({ appendTo: buttonGroup, - type: "input", + type: "button", class: "btn btn-primary btn-flat", elemType: "submit", - value: "Send", }); + //Add send icon + createElem2({ + appendTo: sendButton, + type: "i", + class: "fa fa-send-o", + }); + //Prevent textarea from adding a new line when pressing enter $(inputText).keypress(function(event){ if(event.keyCode == 13){ @@ -575,7 +581,6 @@ ComunicWeb.components.conversations.chatWindows = { } //Lock send button - form.sendButton.value = "Sending"; form.sendButton.disabled = true; //Prepare what to do next @@ -586,7 +591,6 @@ ComunicWeb.components.conversations.chatWindows = { ComunicWeb.common.notificationSystem.showNotification("An error occured while trying to send message! Please try again...", "danger", 2); //Unlock send button - form.sendButton.value = "Send"; form.sendButton.disabled = false; return false; @@ -643,7 +647,6 @@ ComunicWeb.components.conversations.chatWindows = { var form = infos.box.sendMessageForm; //Unlock send button and reset its value - form.sendButton.value = "Send"; form.sendButton.disabled = false; //Empty textarea