Antedit: support horizontal scrolling on horizontal tabbar

This commit is contained in:
lxsang
2022-07-05 22:23:38 +02:00
parent b8734fdc50
commit eb7162b901
11 changed files with 22 additions and 9 deletions

View File

@ -191,7 +191,6 @@ namespace OS {
return false;
}*/
if (!this.currfile.dirty) {
console.log("dirty", this.currfile.path);
this.currfile.dirty = true;
this.currfile.text += "*";
return this.tabbar.update(undefined);
@ -268,7 +267,8 @@ namespace OS {
this.currfile.selected = false;
file.selected = true;
//console.log cnt
this.tabbar.push(file);
const el = this.tabbar.push(file);
this.app.trigger("tab-opened", el);
}
/**

View File

@ -471,7 +471,18 @@ namespace OS {
this.bindKey("ALT-F", () => this.menuAction("opendir"));
this.bindKey("CTRL-S", () => this.menuAction("save"));
this.bindKey("ALT-W", () => this.menuAction("saveas"));
const list_container = $(".list-container", this.find("editor-main-container"));
list_container.each((i,el) => {
$(el).on("wheel", (evt)=>{
el.scrollLeft += (evt.originalEvent as WheelEvent).deltaY;
});
});
this.on("tab-opened", (el) => {
const container = $(el).closest(".list-container");
if(container && container[0])
container[0].scrollLeft = container[0].scrollWidth;
});
this.fileview.ondragndrop = (e) => {
if(!e.data.from || !e.data.to)
{