Skip to content

Commit

Permalink
Fixed the last IE8 bug... hopefully.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Loitsch committed Feb 3, 2011
1 parent 8b3ae25 commit 80f25cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opentip.js
Expand Up @@ -103,7 +103,7 @@ var Opentip = {

// This is a prototype 1.6 bug, that doesn't apply the className to IE8 elements.
// Thanks to Alexander Shakhnovsky for finding the bug, and pinpointing the problem.
if(attributes['className']) {
if(attributes && attributes['className']) {
attributes['className'].split(' ').each(function(class_name){element.addClassName(class_name);});
}

Expand All @@ -120,6 +120,7 @@ var Opentip = {
return element;
},


/* Browser support testing */
vendors: 'Khtml Ms O Moz Webkit'.split(' '),
testDiv: document.createElement('div'),
Expand All @@ -135,8 +136,7 @@ var Opentip = {
};

String.prototype.ot_ucfirst = function() {
var element = $(this);
return element.replace(/^\w/, function(val) { return val.toUpperCase(); });
return this.replace(/^\w/, function(val) { return val.toUpperCase(); });
};

Opentip.load();
Expand Down

0 comments on commit 80f25cb

Please sign in to comment.