* Ensure Event.* generic methods work in IE, even when the event is not extended. [Viktor Kojouharov, Andrew Dupont]
This commit is contained in:
parent
bfd5353cbf
commit
aada1abb56
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Ensure Event.* generic methods work in IE, even when the event is not extended. [Viktor Kojouharov, Andrew Dupont]
|
||||
|
||||
* Don't translate "keypress" events into "keydown" events. [sam]
|
||||
Note: "keypress" is broken in Safari <= 2.x, but Event#stop has no effect on "keydown" events.
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ Event.Methods = (function() {
|
|||
isRightClick: function(event) { return isButton(event, 2) },
|
||||
|
||||
element: function(event) {
|
||||
var node = event.target;
|
||||
var node = Event.extend(event).target;
|
||||
return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node);
|
||||
},
|
||||
|
||||
|
@ -78,6 +78,7 @@ Event.Methods = (function() {
|
|||
pointerY: function(event) { return Event.pointer(event).y },
|
||||
|
||||
stop: function(event) {
|
||||
Event.extend(event);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
|
|
@ -58,6 +58,8 @@
|
|||
<p id="basic">A basic event test - <strong>click here</strong></p>
|
||||
<p id="basic_remove" class="subtest"><strong>click</strong> to stop observing the first test</p>
|
||||
|
||||
<p id="inline_test" onclick="Event.stop(event); $(this).passed();"><strong>click</strong> to ensure generic Event methods work on inline handlers</p>
|
||||
|
||||
<script type="text/javascript">
|
||||
var basic_callback = function(e){
|
||||
$('basic').passed();
|
||||
|
|
Loading…
Reference in New Issue