From 9bcbc473fad51897792579b69d08547c9665fc7b Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Mon, 9 Nov 2009 12:33:23 -0500 Subject: [PATCH] Fix finder. --- common/content/finder.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/common/content/finder.js b/common/content/finder.js index 53a432e4..09195e5e 100644 --- a/common/content/finder.js +++ b/common/content/finder.js @@ -168,7 +168,7 @@ const Finder = Module("finder", { }, // set searchString, searchPattern, caseSensitive, linksOnly - processUserPattern: function (pattern) { + _processUserPattern: function (pattern) { //// strip off pattern terminator and offset //if (backwards) // pattern = pattern.replace(/\?.*/, ""); @@ -372,17 +372,17 @@ const Finder = Module("finder", { clear: function () { this._highlighter.clear(); } +}, { }, { commandline: function () { - const self = this; // Event handlers for search - closure is needed - commandline.registerCallback("change", modes.SEARCH_FORWARD, function (str) { self.onKeyPress(str); }); - commandline.registerCallback("submit", modes.SEARCH_FORWARD, function (str) { self.onSubmit(str); }); - commandline.registerCallback("cancel", modes.SEARCH_FORWARD, function () { self.onCancel(); }); + commandline.registerCallback("change", modes.SEARCH_FORWARD, this.closure.onKeyPress); + commandline.registerCallback("submit", modes.SEARCH_FORWARD, this.closure.onSubmit); + commandline.registerCallback("cancel", modes.SEARCH_FORWARD, this.closure.onCancel); // TODO: allow advanced myModes in register/triggerCallback - commandline.registerCallback("change", modes.SEARCH_BACKWARD, function (str) { self.onKeyPress(str); }); - commandline.registerCallback("submit", modes.SEARCH_BACKWARD, function (str) { self.onSubmit(str); }); - commandline.registerCallback("cancel", modes.SEARCH_BACKWARD, function () { self.onCancel(); }); + commandline.registerCallback("change", modes.SEARCH_BACKWARD, this.closure.onKeyPress); + commandline.registerCallback("submit", modes.SEARCH_BACKWARD, this.closure.onSubmit); + commandline.registerCallback("cancel", modes.SEARCH_BACKWARD, this.closure.onCancel); }, commands: function () {