Permalink
Browse files

Fix last-minute Opera issue detected by spec. This should be the fina…

…l 1.2.1 build!
  • Loading branch information...
1 parent b3c5e57 commit 7c374018ec2f81567592b1da955c045b560e0e8a @SteveSanderson SteveSanderson committed May 22, 2011
Showing with 21 additions and 21 deletions.
  1. +4 −4 build/output/knockout-latest.debug.js
  2. +13 −13 build/output/knockout-latest.js
  3. +4 −4 src/utils.js
@@ -21,10 +21,10 @@ ko.utils = new (function () {
var isIe7 = /MSIE 7/i.test(navigator.userAgent);
// Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup)
- var knownEvents = {
- 'MouseEvents': ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave'],
- 'KeyboardEvent': ['keyup', 'keydown', 'keypress']
- }, knownEventTypesByEventName = {};
+ var knownEvents = {}, knownEventTypesByEventName = {};
+ var keyEventTypeName = /Firefox\/2/i.test(navigator.userAgent) ? 'KeyboardEvent' : 'UIEvents';
+ knownEvents[keyEventTypeName] = ['keyup', 'keydown', 'keypress'];
+ knownEvents['MouseEvents'] = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave'];
for (var eventType in knownEvents) {
var knownEventsForType = knownEvents[eventType];
if (knownEventsForType.length) {

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -5,10 +5,10 @@ ko.utils = new (function () {
var isIe7 = /MSIE 7/i.test(navigator.userAgent);
// Represent the known event types in a compact way, then at runtime transform it into a hash with event name as key (for fast lookup)
- var knownEvents = {
- 'MouseEvents': ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave'],
- 'KeyboardEvent': ['keyup', 'keydown', 'keypress']
- }, knownEventTypesByEventName = {};
+ var knownEvents = {}, knownEventTypesByEventName = {};
+ var keyEventTypeName = /Firefox\/2/i.test(navigator.userAgent) ? 'KeyboardEvent' : 'UIEvents';
+ knownEvents[keyEventTypeName] = ['keyup', 'keydown', 'keypress'];
+ knownEvents['MouseEvents'] = ['click', 'dblclick', 'mousedown', 'mouseup', 'mousemove', 'mouseover', 'mouseout', 'mouseenter', 'mouseleave'];
for (var eventType in knownEvents) {
var knownEventsForType = knownEvents[eventType];
if (knownEventsForType.length) {

0 comments on commit 7c37401

Please sign in to comment.