Revision: 11912
Updated Code
at February 23, 2009 13:11 by zachharkey
Updated Code
$(document).ready(function() {
// Take all divs that match class .admin-links and move them inside of
// the next adjacent sibling div with class .block.
var $blocks = $(".block");
$blocks.each(function() {
var $block = $(this);
var $admin = $(this).prev();
if (!$admin.hasClass("admin-links"))
return $block;
var $copy = $admin.clone(true);
$admin.remove();
$copy.prependTo($block);
});
});
Revision: 11911
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at February 23, 2009 13:08 by zachharkey
Initial Code
// Take all divs that match class .admin-links and move them inside of
// the next adjacent sibling div with class .block.
var $blocks = $(".block");
$blocks.each(function() {
var $block = $(this);
var $admin = $(this).prev();
if (!$admin.hasClass("admin-links"))
return $block;
var $copy = $admin.clone(true);
$admin.remove();
$copy.prependTo($block);
});
Initial URL
Initial Description
Thanks to [James]( http://www.girsbrain.org/blog ) for this code.
Initial Title
Move div.admin-links into the next adjacent sibling div.block
Initial Tags
textmate, jquery, drupal
Initial Language
JavaScript