mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Online editor: check the url to load from a branch
This commit is contained in:
parent
19d4fa17ab
commit
d51ea1429d
1 changed files with 6 additions and 1 deletions
|
@ -61,7 +61,12 @@ export Demo := Window {
|
|||
let select = (<HTMLInputElement>document.getElementById("select_combo"));
|
||||
function select_combo_changed() {
|
||||
if (select.value) {
|
||||
load_from_url("https://raw.githubusercontent.com/sixtyfpsui/sixtyfps/master/" + select.value);
|
||||
let tag = "master";
|
||||
var found;
|
||||
if (found = window.location.pathname.match(/releases\/([^\/]*)\/editor/)) {
|
||||
tag = "v" + found[1];
|
||||
}
|
||||
load_from_url(`https://raw.githubusercontent.com/sixtyfpsui/sixtyfps/${tag}/${select.value}`);
|
||||
} else {
|
||||
clearTabs();
|
||||
base_url = "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue