- Patch #601150 by bganicky: improved contextual links Javascript.

merge-requests/26/head
Dries Buytaert 2010-03-26 18:59:54 +00:00
parent c327b4d407
commit 1c6df63309
1 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ Drupal.behaviors.contextualLinks = {
var $links = $wrapper.find('ul.contextual-links');
var $trigger = $('<a class="contextual-links-trigger" href="#" />').text(Drupal.t('Configure')).click(
function () {
$wrapper.find('ul.contextual-links').stop(true, true).slideToggle(100);
$links.stop(true, true).slideToggle(100);
$wrapper.toggleClass('contextual-links-active');
return false;
}
@ -27,7 +27,7 @@ Drupal.behaviors.contextualLinks = {
// Hide the contextual links when user rolls out of the .contextual-links-region.
$region.bind('mouseleave', Drupal.contextualLinks.mouseleave);
// Prepend the trigger.
$links.end().prepend($trigger);
$wrapper.prepend($trigger);
});
}
};
@ -36,7 +36,7 @@ Drupal.behaviors.contextualLinks = {
* Disables outline for the region contextual links are associated with.
*/
Drupal.contextualLinks.mouseleave = function () {
$(this).closest('.contextual-links-region')
$(this)
.find('.contextual-links-active').removeClass('contextual-links-active')
.find('ul.contextual-links').hide();
};