Commit 81d8a02d authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin

chatview: add save/set/clear functions for the send message input

Change-Id: Ib5a53c0451e1bd776edcb96aa21183a23e212521
parent 3357f53e
......@@ -566,8 +566,6 @@ function sendMessage() {
window.jsbridge.sendFile(file_src[1])
}
sendContainer.innerHTML = ""
sendContainer.style.display = "none"
reduce_send_container()
}
......@@ -2314,6 +2312,8 @@ function grow_send_container() {
/* exported grow_send_container */
function reduce_send_container() {
exec_keeping_scroll_position(function () {
sendContainer.innerHTML = ""
sendContainer.style.display = "none"
backToBottomBtnContainer.style.bottom = "var(--messagebar-size)"
//6em
}, [])
......@@ -2331,7 +2331,6 @@ function remove(e) {
e.parentNode.parentNode.removeChild(e.parentNode)
if (sendContainer.innerHTML.length == 0) {
reduce_send_container()
sendContainer.style.display = "none"
}
}
......@@ -2409,4 +2408,33 @@ function setTheme(theme) {
if (theme != "") {
root.setAttribute("style", theme)
}
}
\ No newline at end of file
}
/**
* Get the content of the send message text field as a string.
* This should be called and the client should wait for
* saveSendMessageContent before calling clearSendMessageContent
* and printHistory when changing conversations.
*
*/
/* exported requestSendMessageContent */
function requestSendMessageContent() {
if (use_qt) {
window.jsbridge.saveSendMessageContent(messageBarInput.value)
} else {
window.prompt("SAVE:" + messageBarInput.value)
}
}
/**
* Sets the content of the send message text field.
* Use an empty string to clear.
*
* * @param contentStr the content
*/
/* exported setSendMessageContent */
function setSendMessageContent(contentStr) {
messageBarInput.value = contentStr
grow_text_area();
reduce_send_container();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment