Commit 1c6df633 authored by Dries's avatar Dries

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

parent c327b4d4
......@@ -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();
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment