diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-18 22:48:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 22:48:51 -0400 |
commit | 8abaa8c76090efdc6c91f4522cc7d37b34967e47 (patch) | |
tree | 6d8a4667ffc2a2cd5900f62bd81e8391ab84319d | |
parent | 8bfaf15e559a23b10566762c19c17862a7f5e949 (diff) | |
parent | e3accd0c0142de984879bd4ccfba526904c32b11 (diff) | |
download | UXP-8abaa8c76090efdc6c91f4522cc7d37b34967e47.tar UXP-8abaa8c76090efdc6c91f4522cc7d37b34967e47.tar.gz UXP-8abaa8c76090efdc6c91f4522cc7d37b34967e47.tar.lz UXP-8abaa8c76090efdc6c91f4522cc7d37b34967e47.tar.xz UXP-8abaa8c76090efdc6c91f4522cc7d37b34967e47.zip |
Merge pull request #203 from janekptacijarabaci/pm_urlbar_dropmarker_1
[PALEMOON] URL/Address/Location bar - suggestions in location bar cannot be hidden by clicking dropmarker again
-rw-r--r-- | application/palemoon/base/content/autocomplete.xml | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/application/palemoon/base/content/autocomplete.xml b/application/palemoon/base/content/autocomplete.xml index 9291b205b..bd0928436 100644 --- a/application/palemoon/base/content/autocomplete.xml +++ b/application/palemoon/base/content/autocomplete.xml @@ -404,7 +404,10 @@ <method name="toggleHistoryPopup"> <body><![CDATA[ - if (!this.popup.popupOpen) + // If this method is called on the same event tick as the popup gets + // hidden, do nothing to avoid re-opening the popup when the drop + // marker is clicked while the popup is still open. + if (!this.popup.isPopupHidingTick && !this.popup.popupOpen) this.showHistoryPopup(); else this.closePopup(); @@ -871,6 +874,7 @@ extends="chrome://global/content/bindings/popup.xml#popup"> <implementation implements="nsIAutoCompletePopup"> <field name="mInput">null</field> <field name="mPopupOpen">false</field> + <field name="mIsPopupHidingTick">false</field> <!-- =================== nsIAutoCompletePopup =================== --> @@ -883,6 +887,9 @@ extends="chrome://global/content/bindings/popup.xml#popup"> <property name="popupOpen" readonly="true" onget="return this.mPopupOpen;"/> + <property name="isPopupHidingTick" readonly="true" + onget="return this.mIsPopupHidingTick;"/> + <method name="closePopup"> <body> <![CDATA[ @@ -989,6 +996,14 @@ extends="chrome://global/content/bindings/popup.xml#popup"> this.removeAttribute("autocompleteinput"); this.mPopupOpen = false; + // Prevent opening popup from historydropmarker mousedown handler + // on the same event tick the popup is hidden by the same mousedown + // event. + this.mIsPopupHidingTick = true; + setTimeout(() => { + this.mIsPopupHidingTick = false; + }, 0); + // Reset the maxRows property to the cached "normal" value, and reset // _normalMaxRows so that we can detect whether it was set by the input // when the popupshowing handler runs. @@ -2103,18 +2118,9 @@ extends="chrome://global/content/bindings/popup.xml#popup"> </binding> <binding id="private-history-dropmarker" extends="chrome://global/content/bindings/general.xml#dropmarker"> - <implementation> - <method name="showPopup"> - <body><![CDATA[ - var textbox = document.getBindingParent(this); - textbox.showHistoryPopup(); - ]]></body> - </method> - </implementation> - <handlers> <handler event="mousedown" button="0"><![CDATA[ - this.showPopup(); + document.getBindingParent(this).toggleHistoryPopup(); ]]></handler> </handlers> </binding> |