Skip to content

Commit 4cf473e

Browse files
committed
Merge branch 'main' of https://github.com/nesnes/teleplot
2 parents e93db17 + db5abae commit 4cf473e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

server/www/classes/view/logs/LogConsole.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ class LogConsole
1111

1212
this.container = document.getElementById("log-container-div");
1313

14+
this.isBeingScrolled = false;
15+
this.container.addEventListener('mousedown', ()=>{this.isBeingScrolled = true; }, false);
16+
this.container.addEventListener('mouseup', ()=>{this.isBeingScrolled = false; }, false);
17+
1418
this.scroller = undefined;
1519
this.config = undefined;
1620

@@ -138,7 +142,7 @@ class LogConsole
138142
{
139143
this.hyperlist.refresh(this.container, this.getHyperListConfig());
140144

141-
if (this.autoScrollToEnd && !app.isViewPaused)
145+
if (this.autoScrollToEnd && !app.isViewPaused && !this.isBeingScrolled)
142146
{
143147
// this.logIndexToHighlighting = -1;
144148
this.container.scrollTop = app.logs.length * this.itemHeight;// this is always greater than the div height, so it will scroll to the end

server/www/main.js

+11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ else {
2020
let port = window.location.port;
2121
conn.connect(addr, port);
2222
app.connections.push(conn);
23+
24+
// Parse url params
25+
let params = new URLSearchParams(window.location.search);
26+
27+
// Open layout from url
28+
let layout = params.get("layout")
29+
if (layout) {
30+
fetch(layout).then(res => res.blob()).then(blob => {
31+
importLayoutJSON({target:{files:[blob]}});
32+
});
33+
}
2334
}
2435

2536

0 commit comments

Comments
 (0)