Merge pull request #2411 from kantlivelong/terminal_autoscroll_enchancements

ENHANCEMENT: Terminal: Autoscroll Enhancements
This commit is contained in:
Gina Häußge authored and GitHub committed 2018-02-08 20:36:57 +01:00
commit 00616a3d73
2 files changed
+16 -1

No files matched your search

@@ -277,6 +277,17 @@ $(function() {
}
};
self.terminalScrollEvent = _.throttle(function () {
if (self.autoscrollEnabled()) {
var container = self.fancyFunctionality() ? $("#terminal-output") : $("#terminal-output-lowfi");
var maxScroll = container[0].scrollHeight - container[0].offsetHeight;
if (container.scrollTop() <= maxScroll ) {
self.autoscrollEnabled(false);
}
}
}, 250);
self.gotoTerminalCommand = function() {
// skip if user highlights text.
var sel = getSelection().toString();
@@ -289,6 +300,10 @@ $(function() {
self.toggleAutoscroll = function() {
self.autoscrollEnabled(!self.autoscrollEnabled());
if (self.autoscrollEnabled()) {
self.updateOutput();
}
};
self.selectAll = function() {
+1 -1
View File
@@ -1,5 +1,5 @@
<div class="terminal">
<pre id="terminal-output" class="pre-scrollable pre-output" data-bind="foreach: displayedLines, visible: fancyFunctionality(), click: function(){ gotoTerminalCommand(); }"><span data-bind="text: line, css: {muted: type == 'filtered' || type == 'cut'}"></span></pre>
<pre id="terminal-output" class="pre-scrollable pre-output" data-bind="foreach: displayedLines, visible: fancyFunctionality(), click: function(){ gotoTerminalCommand(); }, event: { scroll: terminalScrollEvent }"><span data-bind="text: line, css: {muted: type == 'filtered' || type == 'cut'}"></span></pre>
<pre id="terminal-output-lowfi" style="display: none" class="pre-scrollable" data-bind="text: plainLogOutput, visible: !fancyFunctionality()"></pre>
<div id="terminal-sendpanel" style="display: none;" data-bind="visible: loginState.isUser">
<div class="input-block-level input-append">