diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-19 00:19:39 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-19 00:19:39 +0200 |
commit | e3accd0c0142de984879bd4ccfba526904c32b11 (patch) | |
tree | 6d8a4667ffc2a2cd5900f62bd81e8391ab84319d | |
parent | 8bfaf15e559a23b10566762c19c17862a7f5e949 (diff) | |
download | UXP-e3accd0c0142de984879bd4ccfba526904c32b11.tar UXP-e3accd0c0142de984879bd4ccfba526904c32b11.tar.gz UXP-e3accd0c0142de984879bd4ccfba526904c32b11.tar.lz UXP-e3accd0c0142de984879bd4ccfba526904c32b11.tar.xz UXP-e3accd0c0142de984879bd4ccfba526904c32b11.zip |
[PALEMOON] URL/Address/Location bar - suggestions in location bar cannot be hidden by clicking dropmarker again
https://github.com/MoonchildProductions/Pale-Moon/pull/1382
-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> |