From 66f740c58475b84b907326a0e50e4d91c2fc03ee Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 6 Dec 2009 01:00:27 +0000 Subject: - Patch #626286 by sun, David_Rothstein, Rob Loach: make contextual links a module. --- misc/contextual_links.js | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 misc/contextual_links.js (limited to 'misc/contextual_links.js') diff --git a/misc/contextual_links.js b/misc/contextual_links.js deleted file mode 100644 index 0dfc9ddfa..000000000 --- a/misc/contextual_links.js +++ /dev/null @@ -1,42 +0,0 @@ -// $Id$ -(function ($) { - -Drupal.contextualLinks = Drupal.contextualLinks || {}; - -/** - * Attach outline behavior for regions associated with contextual links. - */ -Drupal.behaviors.contextualLinks = { - attach: function (context) { - $('div.contextual-links-wrapper', context).once('contextual-links', function () { - var $wrapper = $(this); - var $trigger = $('').text(Drupal.t('Configure')).click( - function () { - $wrapper.find('ul.contextual-links').slideToggle(100); - $wrapper.toggleClass('contextual-links-active'); - return false; - } - ); - $wrapper.prepend($trigger) - .closest('.contextual-links-region').hover(Drupal.contextualLinks.hover, Drupal.contextualLinks.hoverOut); - }); - } -}; - -/** - * Enables outline for the region contextual links are associated with. - */ -Drupal.contextualLinks.hover = function () { - $(this).closest('.contextual-links-region').addClass('contextual-links-region-active'); -}; - -/** - * Disables outline for the region contextual links are associated with. - */ -Drupal.contextualLinks.hoverOut = function () { - $(this).closest('.contextual-links-region').removeClass('contextual-links-region-active') - .find('.contextual-links-active').removeClass('contextual-links-active') - .find('ul.contextual-links').hide(); -}; - -})(jQuery); -- cgit v1.2.3