summaryrefslogtreecommitdiffstats
path: root/toolkit/content
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-30 23:54:41 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-30 23:54:41 +0200
commit94980111da8fa3cbe24cc20186b239afd41450fa (patch)
treebf1f4715fcf8379eb35c8a787e871d9005f72dc1 /toolkit/content
parent7dfc8b77b94ef102962b474dcbcee272fb8934f7 (diff)
downloadUXP-94980111da8fa3cbe24cc20186b239afd41450fa.tar
UXP-94980111da8fa3cbe24cc20186b239afd41450fa.tar.gz
UXP-94980111da8fa3cbe24cc20186b239afd41450fa.tar.lz
UXP-94980111da8fa3cbe24cc20186b239afd41450fa.tar.xz
UXP-94980111da8fa3cbe24cc20186b239afd41450fa.zip
Bug 1371111 - Open picker when input element's padding area is clicked
+ Bug 1341029: https://bugzilla.mozilla.org/show_bug.cgi?id=1341029 (partially - partially - fix typo in removeEventListener): https://hg.mozilla.org/mozilla-central/diff/6055065a2ed5/toolkit/content/widgets/datetimebox.xml + Bug 1410292: https://bugzilla.mozilla.org/show_bug.cgi?id=1410292
Diffstat (limited to 'toolkit/content')
-rw-r--r--toolkit/content/widgets/datetimebox.xml23
1 files changed, 14 insertions, 9 deletions
diff --git a/toolkit/content/widgets/datetimebox.xml b/toolkit/content/widgets/datetimebox.xml
index c276265a3..c45124ef7 100644
--- a/toolkit/content/widgets/datetimebox.xml
+++ b/toolkit/content/widgets/datetimebox.xml
@@ -1072,6 +1072,10 @@
capture: true,
mozSystemGroup: true
});
+ // This is to open the picker when input element is clicked (this
+ // includes padding area).
+ this.mInputElement.addEventListener("click", this,
+ { mozSystemGroup: true });
// This is to close the picker when input element blurs.
this.mInputElement.addEventListener("blur", this,
{ mozSystemGroup: true });
@@ -1080,22 +1084,26 @@
<destructor>
<![CDATA[
- this.mInputElement = null;
-
this.EVENTS.forEach((eventName) => {
this.removeEventListener(eventName, this, { mozSystemGroup: true });
});
- this.removeEventListener("keypress", onKeyPress, {
+ this.removeEventListener("keypress", this, {
capture: true,
mozSystemGroup: true
});
+ this.mInputElement.removeEventListener("click", this,
+ { mozSystemGroup: true });
+ this.mInputElement.removeEventListener("blur", this,
+ { mozSystemGroup: true });
+
+ this.mInputElement = null;
]]>
</destructor>
<property name="EVENTS" readonly="true">
<getter>
<![CDATA[
- return ["click", "focus", "blur", "copy", "cut", "paste", "mousedown"];
+ return ["focus", "blur", "copy", "cut", "paste", "mousedown"];
]]>
</getter>
</property>
@@ -1413,12 +1421,9 @@
<parameter name="aEvent"/>
<body>
<![CDATA[
- this.log("onClick originalTarget: " + aEvent.originalTarget);
+ this.log("onClick originalTarget: " + aEvent.originalTarget +
+ " target: " + aEvent.target);
- // XXX: .originalTarget is not expected.
- // When clicking on one of the inner text boxes, the .originalTarget is
- // a HTMLDivElement and when clicking on the reset button, it's a
- // HTMLButtonElement.
if (aEvent.defaultPrevented || this.isDisabled() || this.isReadonly()) {
return;
}