ClusterLabs/hawk

View on GitHub
hawk/app/assets/javascripts/module/help.js

Summary

Maintainability
A
30 mins
Test Coverage
// Copyright (c) 2009-2015 Tim Serong <tserong@suse.com>
// See COPYING for license.

$(function() {
  $('[data-help-target]').each(function() {
    $(
      $(this).data('help-target')
    ).hide();
  });

  $(
    document
  ).on('mouseenter', '[data-help-filter]', function() {
    $target = $($(this).parents('[data-help-target]').data('help-target'));

    $target
      .hide()
      .filter($(this).attr('data-help-filter'))
      .show();
  });
});