Commit 2b05e249 authored by John Resig's avatar John Resig

Make jQuery work without warnings in strict mode, in Firefox.

parent 887c0078
...@@ -196,14 +196,14 @@ jQuery.event = { ...@@ -196,14 +196,14 @@ jQuery.event = {
event.preventDefault = function() { event.preventDefault = function() {
// if preventDefault exists run it on the original event // if preventDefault exists run it on the original event
if (originalEvent.preventDefault) if (originalEvent.preventDefault)
return originalEvent.preventDefault(); originalEvent.preventDefault();
// otherwise set the returnValue property of the original event to false (IE) // otherwise set the returnValue property of the original event to false (IE)
originalEvent.returnValue = false; originalEvent.returnValue = false;
}; };
event.stopPropagation = function() { event.stopPropagation = function() {
// if stopPropagation exists run it on the original event // if stopPropagation exists run it on the original event
if (originalEvent.stopPropagation) if (originalEvent.stopPropagation)
return originalEvent.stopPropagation(); originalEvent.stopPropagation();
// otherwise set the cancelBubble property of the original event to true (IE) // otherwise set the cancelBubble property of the original event to true (IE)
originalEvent.cancelBubble = true; originalEvent.cancelBubble = true;
}; };
......
...@@ -340,6 +340,9 @@ jQuery.fn.extend({ ...@@ -340,6 +340,9 @@ jQuery.fn.extend({
else else
e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop ); e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
}); });
// For JS strict compliance
return true;
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment