[Pkg-mozext-commits] [nostalgy] 06/13: Fix some remaining problems (height of popup when we force opening it; showing recent results). Patches by Jens Hatlak.
David Prévot
taffit at moszumanska.debian.org
Fri Feb 6 22:43:57 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository nostalgy.
commit 214adb2e94c8a28cad533f981505baa85242a386
Author: alain.frisch <alain.frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date: Tue Aug 12 08:48:10 2014 +0000
Fix some remaining problems (height of popup when we force opening it; showing recent results). Patches by Jens Hatlak.
git-svn-id: http://nostalgy.googlecode.com/svn/trunk@243 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
content/folders.js | 24 +++++++++++++-----------
content/nostalgy.js | 16 +++++++++++++---
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/content/folders.js b/content/folders.js
index d7290d2..706e56b 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -188,7 +188,8 @@ function NostalgyGetAutoCompleteValuesFunction(box) {
setTimeout(function() {
if (box.popup.state == "closed") {
NostalgyDebug("Forcing popup to be opened");
- box.popup.sizeTo(box.boxObject.width,300);
+ var width = box.getBoundingClientRect().width;
+ box.popup.setAttribute("width", width > 100 ? width : 100);
box.popup.openPopup(box, "before_start", 0, 0, false, false);
} }, 50);
@@ -197,6 +198,15 @@ function NostalgyGetAutoCompleteValuesFunction(box) {
}
+function NostalgyAutocompleteComponent() {
+ var nac =
+ Components
+ .classes["@mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete"]
+ .getService()
+ .wrappedJSObject;
+ return nac;
+}
+
function NostalgyFolderSelectionBox(box) {
var cmd = box.getAttribute("nostalgyfolderbox");
if (cmd) {
@@ -209,12 +219,7 @@ function NostalgyFolderSelectionBox(box) {
}
box.shell_completion = false;
- var nac =
- Components
- .classes["@mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete"]
- .getService()
- .wrappedJSObject;
- box.searchParam = nac.attachGetValuesFunction(NostalgyGetAutoCompleteValuesFunction(box));
+ box.searchParam = NostalgyAutocompleteComponent().attachGetValuesFunction(NostalgyGetAutoCompleteValuesFunction(box));
box.onkeypress=function(event){
@@ -223,11 +228,8 @@ function NostalgyFolderSelectionBox(box) {
if (nostalgy_completion_options.tab_shell_completion) {
box.shell_completion = true;
box.value = NostalgyCompleteUnique(box.value);
- try {
+ if (box.controller) // Toolkit only
box.controller.handleText();
- } catch (ex) {
- NostalgyDebug("err:" + ex);
- }
}
}
};
diff --git a/content/nostalgy.js b/content/nostalgy.js
index 967594a..73e4703 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -311,14 +311,24 @@ function NostalgyCmd(lab,cmd,require_file) {
nostalgy_folderBox.tabScrolling = !nostalgy_completion_options.tab_shell_completion;
setTimeout(function() {
+ // For some unknown reason, doing nostalgyBox.focus immediatly
+ // sometimes does not work...
nostalgy_folderBox.focus();
- //nostalgy_folderBox.processInput();
+
+ // Force search on the empty string (-> recent folders)
+ NostalgyShowRecentFoldersList(nostalgy_folderBox);
}, 0);
- // For some unknown reason, doing nostalgyBox.focus immediatly
- // sometimes does not work...
return true;
}
+function NostalgyShowRecentFoldersList(box) {
+ var listener;
+ if (box.controller) // Toolkit
+ listener = box.controller.QueryInterface(Components.interfaces.nsIAutoCompleteObserver);
+ else // XPFE
+ listener = box.mAutoCompleteObserver;
+ NostalgyAutocompleteComponent().startSearch("", box.searchParam, null, listener);
+}
function NostalgyCreateTag(name) {
var tagService =
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git
More information about the Pkg-mozext-commits
mailing list