Bug Tracker

Changes between Initial Version and Version 1 of Ticket #14880, comment 3


Ignore:
Timestamp:
Apr 14, 2014, 8:47:49 AM (5 years ago)
Author:
dmethvin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14880, comment 3

    initial v1  
    22"While browsers use differing properties to store this information, jQuery normalizes the .which property so you can reliably use it to retrieve the key code."
    33
    4 
     4{{{
    55------ Output from Chrome ("+" key) ------
    66
     
    99originalEvent: [object KeyboardEvent],
    1010type: keydown,
    11 isDefaultPrevented: function returnFalse() {
    12         return false;
    13 },
    1411timeStamp: 1397476836189,
    1512jQuery110208109870944172144: true,
     
    3330handleObj: [object Object],
    3431data: null,
    35 isPropagationStopped: function returnFalse() {
    36         return false;
    37 },
    38 isImmediatePropagationStopped: function returnFalse() {
    39         return false;
    40 },
    41 preventDefault: function () {
    42                 var e = this.originalEvent;
    43 
    44                 this.isDefaultPrevented = returnTrue;
    45                 if ( !e ) {
    46                         return;
    47                 }
    48 
    49                 // If preventDefault exists, run it on the original event
    50                 if ( e.preventDefault ) {
    51                         e.preventDefault();
    52 
    53                 // Support: IE
    54                 // Otherwise set the returnValue property of the original event to false
    55                 } else {
    56                         e.returnValue = false;
    57                 }
    58         },
    59 stopPropagation: function () {
    60                 var e = this.originalEvent;
    61 
    62                 this.isPropagationStopped = returnTrue;
    63                 if ( !e ) {
    64                         return;
    65                 }
    66                 // If stopPropagation exists, run it on the original event
    67                 if ( e.stopPropagation ) {
    68                         e.stopPropagation();
    69                 }
    70 
    71                 // Support: IE
    72                 // Set the cancelBubble property of the original event to true
    73                 e.cancelBubble = true;
    74         },
    75 stopImmediatePropagation: function () {
    76                 this.isImmediatePropagationStopped = returnTrue;
    77                 this.stopPropagation();
    78         }
    79 }
    80 
    8132
    8233----- Output from Firefox ("+" key)-----
     
    8536originalEvent: [object KeyboardEvent],
    8637type: keydown,
    87 isDefaultPrevented: function returnFalse() { return false; },
    8838timeStamp: 153805815,
    8939jQuery110206712352453989763: true,
     
    10757handleObj: [object Object],
    10858data: null,
    109 isPropagationStopped: function returnFalse() { return false; },
    110 isImmediatePropagationStopped: function returnFalse() { return false; },
    111 preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( !e ) { return; } // If preventDefault exists, run it on the original event if ( e.preventDefault ) { e.preventDefault(); // Support: IE // Otherwise set the returnValue property of the original event to false } else { e.returnValue = false; } },
    112 stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( !e ) { return; } // If stopPropagation exists, run it on the original event if ( e.stopPropagation ) { e.stopPropagation(); } // Support: IE // Set the cancelBubble property of the original event to true e.cancelBubble = true; },
    113 stopImmediatePropagation: function () { this.isImmediatePropagationStopped = returnTrue; this.stopPropagation(); }
    114 }
    115 
    116 
     59}}}
    11760---
    11861PLEASE REOPEN