/[drupal]/drupal/misc/contextual_links.js
ViewVC logotype

Contents of /drupal/misc/contextual_links.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Sat Oct 17 05:50:27 2009 UTC (6 weeks ago) by webchick
Branch: MAIN
CVS Tags: DRUPAL-7-0-UNSTABLE-10, HEAD
File MIME type: text/javascript
#473268 by David_Rothstein, sun, yoroy, Gábor Hojtsy, cwgordon7, et al.: Allow contextual editing of dang near everything on the page. Also adds a context system to menu local tasks.
1 // $Id$
2 (function ($) {
3
4 Drupal.contextualLinks = Drupal.contextualLinks || {};
5
6 /**
7 * Attach outline behavior for regions associated with contextual links.
8 */
9 Drupal.behaviors.contextualLinks = {
10 attach: function (context) {
11 $('ul.contextual-links', context).once('contextual-links', function () {
12 $(this).hover(Drupal.contextualLinks.hover, Drupal.contextualLinks.hoverOut);
13 });
14 }
15 };
16
17 /**
18 * Enables outline for the region contextual links are associated with.
19 */
20 Drupal.contextualLinks.hover = function () {
21 $(this).addClass('contextual-links-link-active')
22 .closest('.contextual-links-region').addClass('contextual-links-region-active');
23 };
24
25 /**
26 * Disables outline for the region contextual links are associated with.
27 */
28 Drupal.contextualLinks.hoverOut = function () {
29 $(this).removeClass('contextual-links-link-active')
30 .closest('.contextual-links-region').removeClass('contextual-links-region-active');
31 };
32
33 })(jQuery);

  ViewVC Help
Powered by ViewVC 1.1.2