mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-17 00:35:46 +01:00
Add search to the MOW, skip search results in hidden nodes, and fix MOW sizing issues.
This commit is contained in:
@@ -275,7 +275,7 @@ var Buffer = Module("buffer", {
|
||||
*/
|
||||
get localStore() {
|
||||
let doc = content.document;
|
||||
let store = overlay.getData(doc, "buffer");
|
||||
let store = overlay.getData(doc, "buffer", null);
|
||||
if (!store || !buffer.localStorePrototype.isPrototypeOf(store))
|
||||
store = overlay.setData(doc, "buffer", Object.create(buffer.localStorePrototype));
|
||||
return store.instance = store;
|
||||
|
||||
@@ -153,6 +153,8 @@ var CommandWidgets = Class("CommandWidgets", {
|
||||
}
|
||||
});
|
||||
this.updateVisibility();
|
||||
|
||||
this.initialized = true;
|
||||
},
|
||||
addElement: function addElement(obj) {
|
||||
const self = this;
|
||||
@@ -250,6 +252,9 @@ var CommandWidgets = Class("CommandWidgets", {
|
||||
Array.forEach(node.children, check);
|
||||
}
|
||||
[this.commandbar.container, this.statusbar.container].forEach(check);
|
||||
|
||||
if (this.initialized && loaded.mow && mow.visible)
|
||||
mow.resize(false);
|
||||
},
|
||||
|
||||
active: Class.Memoize(Object),
|
||||
|
||||
@@ -103,12 +103,15 @@ var MOW = Module("mow", {
|
||||
if (modes.main != modes.OUTPUT_MULTILINE) {
|
||||
modes.push(modes.OUTPUT_MULTILINE, null, {
|
||||
onKeyPress: this.closure.onKeyPress,
|
||||
|
||||
leave: this.closure(function leave(stack) {
|
||||
if (stack.pop)
|
||||
for (let message in values(this.messages))
|
||||
if (message.leave)
|
||||
message.leave(stack);
|
||||
})
|
||||
}),
|
||||
|
||||
window: this.window
|
||||
});
|
||||
this.messages = [];
|
||||
}
|
||||
@@ -241,12 +244,14 @@ var MOW = Module("mow", {
|
||||
|
||||
let doc = this.widget.contentDocument;
|
||||
|
||||
let availableHeight = config.outputHeight;
|
||||
let trim = Math.max(0, DOM("#" + config.ids.commandContainer, document).rect.bottom - window.innerHeight);
|
||||
let availableHeight = config.outputHeight - trim;
|
||||
if (this.visible)
|
||||
availableHeight += parseFloat(this.widgets.mowContainer.height || 0);
|
||||
availableHeight -= extra || 0;
|
||||
|
||||
doc.body.style.minWidth = this.widgets.commandbar.commandline.scrollWidth + "px";
|
||||
|
||||
this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px";
|
||||
this.timeout(function ()
|
||||
this.widgets.mowContainer.height = Math.min(doc.body.clientHeight, availableHeight) + "px",
|
||||
|
||||
Reference in New Issue
Block a user