From 11406bb5028f8c267a3aad98acf6ba2174da278d Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Wed, 5 Mar 2003 13:30:24 +0000 Subject: [PATCH] Bug 116441 [clickSelectsAll] should not trigger if click is after end of URL r=jag sr=bz --- modules/libpref/src/init/all.js | 2 ++ modules/libpref/src/mac/macprefs.js | 2 ++ xpfe/browser/resources/content/navigator.js | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 4fcf9557e72f..a7d24d41c095 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -164,6 +164,8 @@ pref("browser.search.powermode", 0); pref("browser.search.basic.min_ver", "0.0"); pref("browser.urlbar.autocomplete.enabled", true); pref("browser.urlbar.clickSelectsAll", true); +// when clickSelectsAll=true, does it also apply when the click is past end of text? +pref("browser.urlbar.clickAtEndSelects", true); pref("browser.history_expire_days", 9); pref("browser.history.grouping", "day"); diff --git a/modules/libpref/src/mac/macprefs.js b/modules/libpref/src/mac/macprefs.js index 649265650362..af554416525f 100644 --- a/modules/libpref/src/mac/macprefs.js +++ b/modules/libpref/src/mac/macprefs.js @@ -180,6 +180,8 @@ pref("font.size.fixed.zh-CN", 16); pref("font.size.variable.zh-TW", 15); pref("font.size.fixed.zh-TW", 16); +pref("browser.urlbar.clickAtEndSelects", false); + // Tab focus model bit field: // 1 focuses text controls, 2 focuses other form elements, 4 adds links. pref("accessibility.tabfocus", 1); diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index 0387922ee81e..c6ebf4e78808 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -53,6 +53,7 @@ var gLastValidURLStr = ""; var gLastValidURL = null; var gHaveUpdatedToolbarState = false; var gClickSelectsAll = false; +var gClickAtEndSelects = false; var gIgnoreFocus = false; var gIgnoreClick = false; var gURIFixup = null; @@ -602,6 +603,7 @@ function Startup() // does clicking on the urlbar select its contents? gClickSelectsAll = pref.getBoolPref("browser.urlbar.clickSelectsAll"); + gClickAtEndSelects = pref.getBoolPref("browser.urlbar.clickAtEndSelects"); // now load bookmarks after a delay setTimeout(LoadBookmarksCallback, 0); @@ -1807,8 +1809,9 @@ function URLBarMouseDownHandler(aEvent) function URLBarClickHandler(aEvent) { - if (!gIgnoreClick && gClickSelectsAll && gURLBar.selectionStart == gURLBar.selectionEnd && gURLBar.selectionStart < gURLBar.value.length) - gURLBar.select(); + if (!gIgnoreClick && gClickSelectsAll && gURLBar.selectionStart == gURLBar.selectionEnd) + if (gClickAtEndSelects || gURLBar.selectionStart < gURLBar.value.length) + gURLBar.select(); } // This function gets the "windows hooks" service and has it check its setting