diff --git a/includes/admin.devel.js b/includes/admin.devel.js index d6631fd..e7b79ac 100644 --- a/includes/admin.devel.js +++ b/includes/admin.devel.js @@ -8,7 +8,15 @@ Drupal.behaviors.adminDevel.attach = function(context) { // Pull logged values from footer output into the block. $('li', devel).each(function() { - var key = $(this).attr('class').split(' ')[0]; + if (typeof $.fn.prop === 'function') { + // jQuery >= 1.6 + var key = $(this).prop('class').split(' ')[0]; + } + else { + // jQuery < 1.6 + var key = $(this).attr('class').split(' ')[0]; + } + if (key && $('body > .'+key).size() > 0) { var value = $('body > .'+key).html(); $('div.dev-info', this).html(value); @@ -33,4 +41,4 @@ Drupal.behaviors.adminDevel.attach = function(context) { }); }; -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/includes/admin.menu.js b/includes/admin.menu.js index e236fc2..a2844b5 100644 --- a/includes/admin.menu.js +++ b/includes/admin.menu.js @@ -14,8 +14,16 @@ Drupal.behaviors.adminToolbarMenu.attach = function(context) { menu.addClass('admin-toolbar-menu-hover'); $('a:has(span.menu-description)', menu).hover( function() { + if (typeof $.fn.prop === 'function') { + // jQuery >= 1.6 + var cls = $(this).prop('class'); + } + else { + // jQuery < 1.6 + var cls = $(this).attr('class'); + } $('') - .attr('class', $(this).attr('class')) + .attr('class', cls) .addClass('menu-hover') .addClass('overlay-exclude') .append($('span.menu-description', this).clone()) @@ -62,4 +70,4 @@ Drupal.behaviors.adminToolbarMenu.attach = function(context) { } }; -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/includes/jquery.drilldown.js b/includes/jquery.drilldown.js index 5e085fb..2f49a41 100644 --- a/includes/jquery.drilldown.js +++ b/includes/jquery.drilldown.js @@ -3,11 +3,11 @@ * Generic menu drilldown plugin for standard Drupal menu tree markup. * The plugin should be inited against a DOM element that *contains* * a Drupal ul.menu tree. Example: - * + * * $('div.block-menu').drilldown('init', params); - * + * * You must provide the following parameters as settings: - * + * * var params = { * activePath : A drupal menu path that is currently active including the basePath e.g. "/mysite/node" * trail : A jquery selector to the DOM element that should act as the trail container, e.g. "div.my-menu-breadcrumb-trail" @@ -79,17 +79,14 @@ if (breadcrumb.length > 0) { var trail = $(settings.trail); trail.empty(); - for (var key in breadcrumb) { - if (breadcrumb[key]) { - // We don't use the $().clone() method here because of an - // IE & jQuery 1.2 bug. - var clone = $('') - .attr('href', $(breadcrumb[key]).attr('href')) - .attr('class', $(breadcrumb[key]).attr('class')) - .html($(breadcrumb[key]).html()) - .addClass('depth-'+key) - .appendTo(trail); + var numberOfCrumbs=breadcrumb.length; + for (var key = 0; key < numberOfCrumbs; key++) { + var clone = $(breadcrumb[key]).clone() + .addClass('depth-'+key) + .appendTo(trail); + + if (breadcrumb[key]) { // We add a reference to the original link and a click handler // that traces back to that instance to set as the active link. $('a.depth-'+key, trail)