Bug 1563151 - Restore use of modifier keys for minimonth key events; r=darktrojan a=jorgk CLOSED TREE
authorPaul Morris <paul@paulwmorris.com>
Mon, 08 Jul 2019 10:07:59 -0400
changeset 36053 0549ec9b0487dbd1b9a0c4564c7e39192c6ccd9f
parent 36052 24ee20470ce85851791de668a512347385941067
child 36054 98ee2d4ceaca634121e90539e09d4a4b12274887
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersdarktrojan, jorgk
bugs1563151
Bug 1563151 - Restore use of modifier keys for minimonth key events; r=darktrojan a=jorgk CLOSED TREE The modifier key behavior was lost when de-xbl-ing minimonth. Restore it as it was before.
calendar/base/content/widgets/calendar-minimonth.js
--- a/calendar/base/content/widgets/calendar-minimonth.js
+++ b/calendar/base/content/widgets/calendar-minimonth.js
@@ -170,34 +170,45 @@
                 if (event.button == 0 &&
                     event.originalTarget.classList.contains("minimonth-day")) {
                     this.onDayActivate(event);
                 }
             });
 
             this.addEventListener("keypress", (event) => {
                 if (event.originalTarget.classList.contains("minimonth-day")) {
+                    if (event.altKey || event.metaKey) {
+                        return;
+                    }
                     switch (event.keyCode) {
                         case KeyEvent.DOM_VK_LEFT:
                             this.onDayMovement(event, 0, 0, -1);
                             break;
                         case KeyEvent.DOM_VK_RIGHT:
                             this.onDayMovement(event, 0, 0, 1);
                             break;
                         case KeyEvent.DOM_VK_UP:
                             this.onDayMovement(event, 0, 0, -7);
                             break;
                         case KeyEvent.DOM_VK_DOWN:
                             this.onDayMovement(event, 0, 0, 7);
                             break;
                         case KeyEvent.DOM_VK_PAGE_UP:
-                            this.onDayMovement(event, 0, -1, 0);
+                            if (event.shiftKey) {
+                                this.onDayMovement(event, -1, 0, 0);
+                            } else {
+                                this.onDayMovement(event, 0, -1, 0);
+                            }
                             break;
                         case KeyEvent.DOM_VK_PAGE_DOWN:
-                            this.onDayMovement(event, 0, 1, 0);
+                            if (event.shiftKey) {
+                                this.onDayMovement(event, 1, 0, 0);
+                            } else {
+                                this.onDayMovement(event, 0, 1, 0);
+                            }
                             break;
                         case KeyEvent.DOM_VK_ESCAPE:
                             this.focusDate(this.mValue || this.mExtraDate);
                             event.stopPropagation();
                             event.preventDefault();
                             break;
                         case KeyEvent.DOM_VK_HOME: {
                             const today = new Date();