[fix] hide popover
This commit is contained in:
parent
e32ff3d77a
commit
e32e3437a1
2 changed files with 48 additions and 43 deletions
|
@ -16,9 +16,10 @@
|
|||
<body>
|
||||
<nav class="navbar bg-body-tertiary">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand">BaseX LSP client</a>
|
||||
<a href="/dba/logs" target="dba">#</a>
|
||||
|
||||
|
||||
<div class="btn-toolbar" role="toolbar" aria-label="Toolbar with button groups">
|
||||
<a class="navbar-brand">BaseX LSP client</a>
|
||||
<button id="popcon" popovertarget="mypopover" class="btn btn-danger">
|
||||
<i class="bi bi-router"></i>
|
||||
</button>
|
||||
|
@ -29,6 +30,7 @@
|
|||
<button id="connect">connect</button>
|
||||
</div>
|
||||
</div>
|
||||
<a href="/dba/logs" target="dba">#</a>
|
||||
<div class="row">
|
||||
<div>
|
||||
<select id="language">
|
||||
|
|
|
@ -68,6 +68,7 @@ function connect() {
|
|||
transport.socket.onclose = (event) => connectStatus(false);
|
||||
transport.socket.oneror = (event) => $("msg").innerText = "sock error!";
|
||||
client = new lsp.LSPClient().connect(transport);
|
||||
$("mypopover").hidePopover();
|
||||
connectStatus(true);
|
||||
let extLsp = lsp.languageServerSupport(client, file, "xquery");
|
||||
extLint = lsp.linter(
|
||||
|
@ -77,7 +78,8 @@ function connect() {
|
|||
const state = lsp.createEditorState(doc, [...lsp.baseExts, extLsp, extLint]);
|
||||
view.setState(state);
|
||||
})
|
||||
.catch(r => alert("connection failed: "+ server));
|
||||
.catch(r => { connectStatus(false); alert("connection failed: " + server) });
|
||||
|
||||
};
|
||||
|
||||
function connectStatus(bool) {
|
||||
|
@ -88,7 +90,8 @@ $("popcon").classList.add("btn-success")
|
|||
$("popcon").classList.add("btn-danger")
|
||||
$("popcon").classList.remove("btn-success")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function incoming(msg) {
|
||||
const rpc = JSON.parse(msg);
|
||||
log(rpc);
|
||||
|
|
Loading…
Add table
Reference in a new issue