mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 01:47:59 +01:00
Fix completion list sizing issues.
This commit is contained in:
@@ -1877,10 +1877,8 @@ var ItemList = Class("ItemList", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onResize: function onResize() {
|
onResize: function onResize() {
|
||||||
if (this.selectedGroup) {
|
if (this.selectedGroup)
|
||||||
this.nodes.root.scrollIntoView(true);
|
this.selectedGroup.rescrollFunc();
|
||||||
DOM(this.selectedGroup.selectRow).scrollIntoView();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
minHeight: 0,
|
minHeight: 0,
|
||||||
@@ -1897,14 +1895,15 @@ var ItemList = Class("ItemList", {
|
|||||||
if (!this.visible)
|
if (!this.visible)
|
||||||
root.style.minWidth = "";
|
root.style.minWidth = "";
|
||||||
|
|
||||||
if (minHeight <= this.minHeight || !mow.visible)
|
let height = this.visible ? parseFloat(this.container.height) : 0;
|
||||||
this.container.height = this.minHeight;
|
if (this.minHeight <= minHeight || !mow.visible)
|
||||||
|
this.container.height = Math.min(this.minHeight,
|
||||||
|
height + config.outputHeight - mow.spaceNeeded);
|
||||||
else {
|
else {
|
||||||
// FIXME: Belongs elsewhere.
|
// FIXME: Belongs elsewhere.
|
||||||
mow.resize(false, Math.max(0, this.minHeight - this.container.height));
|
mow.resize(false, Math.max(0, this.minHeight - this.container.height));
|
||||||
|
|
||||||
this.container.height = this.minHeight;
|
this.container.height = this.minHeight - mow.spaceNeeded;
|
||||||
this.container.height -= mow.spaceNeeded;
|
|
||||||
mow.resize(false);
|
mow.resize(false);
|
||||||
this.timeout(function () {
|
this.timeout(function () {
|
||||||
this.container.height -= mow.spaceNeeded;
|
this.container.height -= mow.spaceNeeded;
|
||||||
@@ -2014,9 +2013,19 @@ var ItemList = Class("ItemList", {
|
|||||||
let start = DOM(this.getRow(this.range.start)).rect.top;
|
let start = DOM(this.getRow(this.range.start)).rect.top;
|
||||||
let height = DOM(this.getRow(this.range.end - 1)).rect.bottom - start || 0;
|
let height = DOM(this.getRow(this.range.end - 1)).rect.bottom - start || 0;
|
||||||
let scroll = start + container.scrollTop - pos;
|
let scroll = start + container.scrollTop - pos;
|
||||||
|
|
||||||
|
let win = this.win;
|
||||||
|
let row = this.selectedRow;
|
||||||
|
if (row) {
|
||||||
|
let { rect } = DOM(this.selectedRow);
|
||||||
|
var scrollY = this.win.scrollY + rect.bottom - this.win.innerHeight;
|
||||||
|
}
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
container.style.height = height + "px";
|
container.style.height = height + "px";
|
||||||
container.scrollTop = scroll;
|
container.scrollTop = scroll;
|
||||||
|
if (scrollY != null)
|
||||||
|
win.scrollTo(0, Math.max(scrollY, 0));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ var MOW = Module("mow", {
|
|||||||
|
|
||||||
let doc = this.widget.contentDocument;
|
let doc = this.widget.contentDocument;
|
||||||
|
|
||||||
let trim = Math.max(0, DOM("#" + config.ids.commandContainer, document).rect.bottom - window.innerHeight);
|
let trim = this.spaceNeeded;
|
||||||
let availableHeight = config.outputHeight - trim;
|
let availableHeight = config.outputHeight - trim;
|
||||||
if (this.visible)
|
if (this.visible)
|
||||||
availableHeight += parseFloat(this.widgets.mowContainer.height || 0);
|
availableHeight += parseFloat(this.widgets.mowContainer.height || 0);
|
||||||
@@ -262,11 +262,7 @@ var MOW = Module("mow", {
|
|||||||
this.visible = true;
|
this.visible = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
get spaceNeeded() {
|
get spaceNeeded() Math.max(0, DOM("#" + config.ids.commandContainer, document).rect.bottom - window.innerHeight),
|
||||||
let rect = this.widgets.commandbar.commandline.getBoundingClientRect();
|
|
||||||
let offset = rect.bottom - window.innerHeight;
|
|
||||||
return Math.max(0, offset);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update or remove the multi-line output widget's "MORE" prompt.
|
* Update or remove the multi-line output widget's "MORE" prompt.
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ var Cache = Module("Cache", XPCOM(Ci.nsIRequestObserver), {
|
|||||||
}
|
}
|
||||||
catch (e if e.result == Cr.NS_ERROR_FILE_CORRUPTED) {
|
catch (e if e.result == Cr.NS_ERROR_FILE_CORRUPTED) {
|
||||||
util.reportError(e);
|
util.reportError(e);
|
||||||
|
this.closeWriter();
|
||||||
this.cacheFile.remove(false);
|
this.cacheFile.remove(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user