r1513 - branches/experimental/tabbable
Author: scott.gonzalez
Date: Sun Jan 4 18:07:05 2009
New Revision: 1513
Modified:
branches/experimental/tabbable/ui.core.js
Log:
Tabbable: jQuery.support implementation for tabindex.
Modified: branches/experimental/tabbable/ui.core.js
==============================================================================
--- branches/experimental/tabbable/ui.core.js (original)
+++ branches/experimental/tabbable/ui.core.js Sun Jan 4 18:07:05 2009
@@ -1,10 +1,17 @@
(function($) {
+// use jQuery.support so we can land this in jQuery 1.3
+(function() {
+ $.support = {};
+ var div = document.createElement('div');
+ div.innerHTML = ' <link/><table></table><a href="/a"
style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param></object>';
+ var a = div.getElementsByTagName("a")[0];
+ $.support.tabindex = !a.getAttributeNode('tabindex');
+})();
+
+
var attr = $.attr,
- // TODO: determine which case to use for IE8
- normalizedTabindex = ($.browser.msie && parseInt($.browser.version, 10) <
8
- ? 'tabIndex'
- : 'tabindex');
+ normalizedTabindex = ($.support.tabindex ? 'tabindex' : 'tabIndex');
$.attr = function(elem, key, value) {
if (/tabindex/i.test(key)) {