fix: graph init bugs when changing git repository

This commit is contained in:
lxsang 2022-07-04 23:01:35 +02:00
parent 0d1957387c
commit 522031dac0
8 changed files with 29 additions and 15 deletions

View File

@ -85,14 +85,22 @@ namespace OS {
{ {
this.options[k] = option[k]; this.options[k] = option[k];
} }
this.current_y_offset = this.options.y_offset; if(this.options.target)
this.init_graph(); {
$(this.options.target)
.addClass("git_grapth_container")
.css("overflow-y", "auto")
.css("overflow-x", "hidden")
.css("display", "block")
.css("position", "relative");
}
} }
set base_dir(v: VFS.BaseFileHandle) set base_dir(v: VFS.BaseFileHandle)
{ {
this._base_dir = v; this._base_dir = v;
if(v) if(v)
{ {
this.init_graph();
this.render_next(); this.render_next();
} }
@ -157,12 +165,17 @@ namespace OS {
{ {
return this.error(API.throwe("Target element is undefined")); return this.error(API.throwe("Target element is undefined"));
} }
$(this.options.target) this.current_y_offset = this.options.y_offset;
.addClass("git_grapth_container") this.lines_data = [];
.css("overflow-y", "auto") this.commits = {};
.css("overflow-x", "hidden") this.oldest_commit_date = undefined;
.css("display", "block") this.svg_element = undefined;
.css("position", "relative"); this.commits_list_element = undefined;
this.load_more_el = undefined;
this.commit_detail_el = undefined;
this.current_head = undefined;
$(this.options.target).empty();
this.svg_element = this.make_svg_el("svg",{ this.svg_element = this.make_svg_el("svg",{
width: this.options.x_offset, width: this.options.x_offset,
height: this.options.y_offset height: this.options.y_offset
@ -173,7 +186,6 @@ namespace OS {
.css("left", "0") .css("left", "0")
//s.css("z-index", 10) //s.css("z-index", 10)
.css("top", "0"); .css("top", "0");
$(this.options.target).empty();
this.options.target.appendChild(this.svg_element); this.options.target.appendChild(this.svg_element);
const div = $("<div />") const div = $("<div />")
.css("position", "absolute") .css("position", "absolute")

View File

@ -14,5 +14,6 @@ graph.base_dir = "home://workspace/repo-git";
``` ```
## Change logs: ## Change logs:
- v0.1.2-b: add class to container element - v0.1.2-b: fix init bug
- v0.1.1-b: add class to container element
- v0.1.0-b: Initial version - v0.1.0-b: Initial version

View File

@ -14,5 +14,6 @@ graph.base_dir = "home://workspace/repo-git";
``` ```
## Change logs: ## Change logs:
- v0.1.2-b: add class to container element - v0.1.2-b: fix init bug
- v0.1.1-b: add class to container element
- v0.1.0-b: Initial version - v0.1.0-b: Initial version

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@
"author": "Dany LE", "author": "Dany LE",
"email": "contact@iohub.dev" "email": "contact@iohub.dev"
}, },
"version":"0.1.1-a", "version":"0.1.2-a",
"category":"Development", "category":"Development",
"iconclass":"bi bi-git", "iconclass":"bi bi-git",
"mimes":["dir"], "mimes":["dir"],

Binary file not shown.

View File

@ -7,7 +7,7 @@
"author": "Dany LE", "author": "Dany LE",
"email": "contact@iohub.dev" "email": "contact@iohub.dev"
}, },
"version":"0.1.1-a", "version":"0.1.2-a",
"category":"Development", "category":"Development",
"iconclass":"bi bi-git", "iconclass":"bi bi-git",
"mimes":["dir"], "mimes":["dir"],

View File

@ -165,7 +165,7 @@
"description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GitGraph/README.md", "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GitGraph/README.md",
"category": "Development", "category": "Development",
"author": "Dany LE", "author": "Dany LE",
"version": "0.1.1-a", "version": "0.1.2-a",
"dependencies": [], "dependencies": [],
"download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GitGraph/build/release/GitGraph.zip" "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/GitGraph/build/release/GitGraph.zip"
}, },