Skip to content

Commit

Permalink
Merge pull request #31 from vloup/signal-text-wrap
Browse files Browse the repository at this point in the history
Signal UI improvements.
  • Loading branch information
danbia authored Feb 10, 2017
2 parents 4831b01 + ade0f47 commit 043b84a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 8 additions & 2 deletions static/js/signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ Interlock.Signal.getHistoryCallback = function(backendData, args) {
/* ensure that the history poller for the selected contact is
still active before to actually refresh the chat history */
if (Interlock.Signal.historyPollerInterval[args.contact] > 0) {
$('#history').text(backendData.response);
$('#history').scrollTop(10000);
if ($('#history').text() !== backendData.response) {
if ($('#history').scrollTop() + $('#history').height() === $('#history').prop('scrollHeight')) {
$('#history').text(backendData.response);
$('#history').scrollTop($('#history').prop('scrollHeight'));
} else {
$('#history').text(backendData.response);
}
}
}
} else {
Interlock.Session.createEvent({'kind': backendData.status,
Expand Down
5 changes: 4 additions & 1 deletion static/styles/interlock.css
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,11 @@ h1 {
}

.history_contents {
height: 337px;
height: 333px;
overflow-y: auto;
white-space: pre-wrap;
word-wrap: break-word;
word-break: break-all;
}

.ui-widget-content textarea.key::-webkit-input-placeholder { font-family: 'Arial', sans-serif }
Expand Down

0 comments on commit 043b84a

Please sign in to comment.